GithubHelp home page GithubHelp logo

caesar-rotation's Introduction

DNI

Julius Caesar the perpetual dilator used a code when he wanted to keep a message secret. The encryption consisted of substituting the first letter of the alphabet, A, for the fourth, D, and so on with the others, that is, the second, B, for the fifth, E, the third, C, for the sixth, F. ...
The Latin alphabet used by Julius Caesar consisted of 21 letters, therefore the substitution of letters to encrypt or decrypt messages was described in the following table

A B C D E F G H I J K L M N O P Q R S T U V
D E F G H I J K L M N O P Q R S T V A B C

But we will use the spanish alphabet in this case

A B C D E F G H I J K L M N ร‘ O P Q R S T U V W X Y Z
D E F G H I J K L M N ร‘ O P Q R S T V W X Y Z A B C

To encrypt a message, for example a phrase that the emperor pronounced, "ALEA IACTA EST" (the die is cast), just look for the letter written in the first row of the previous table and write the letter that is in the row of below. The decryption procedure is the reverse; Given an encrypted message, each letter in the message is looked up in the row below and the letter in the row above is written.


Result:
A L E A I A C T A E S T
D O H D M D F A D H A B

This result was obtained by executing the code with the Latin alphabet, it is up to you to run it with your alphabet


This type of encryption is a substitution code, since each letter is replaced by another. More specifically, we can say that it is a rotation code, since two consecutive letters of the original alphabet correspond to two consecutive letters of the encrypted alphabet (if we consider a circular representation of the alphabet)

To run: npm run start [-- text]

caesar-rotation's People

Contributors

sito8943 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.