Caesar Cipher

We live in a world where privacy is the utmost importance to an individual, an organization or even a puppy (trust me on it). Gone were the  days when people used to hide their information in their little diaries and get scared when it get stolen. Now you could lose more than those few embarrassing moments.

That’s where encryption comes in. The information you want to be shared with your Friends and Family should be encrypted in such a way that no other should be able to access it.


The translation of data into a secret code is called encryption. The data is called a simple message and the secret code is called Encrypted message. Now there is also another concept which is used in encryption, it’s called a Key. Now the key is a piece of information that plays a vital role in transforming the data into cipher and back (called decryption).

Caesar Cipher

In cryptography, a Caesar cipher, also known as Caesar’s cipher, the shift cipher, Caesar’s code or Caesar shift, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. The method is named after Julius Caesar, who used it in his private correspondence.


Caesar Cipher may be the simplest cipher out there but it has played a very crucial role in building the encryption world today. So It’s the first door we would cross on our journey into the world of secrecy.

How does it work?

To pass an encrypted message from one person to another, it is first necessary that both parties have the ‘key’ for the cipher, so that the sender may encrypt it and the receiver may decrypt it. For the Caesar cipher, the key is the number of characters to shift the cipher alphabet.

What it means is that taking a domain of lowercase characters, the encrypted text at a specific character is found out by shifting the character of the original message by a specific offset determined by the key.


Message: this is the life
Key: 2
Encrypted Text: vjku ku vjg nkhg

The Code to implement Caesar Cipher in javascript is available here. I suggest you had fun with it.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s