Professional Documents
Culture Documents
A Caesar cipher, also known as Caesar's cipher, the shift cipher, Caesar's code or Caesar shift, is one of the simplest and widely known encryption techniques. In this type of substitution cipher 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. As with all single alphabet substitution ciphers, the Caesar cipher is easily broken and in modern practice offers essentially no communication security.
EXAMPLE
The transformation can be represented by a ligning two alphabets; the cipher alphabet is the plain alphabet rotated left or right by some number of positions. For instance, here is a Caesar cipher using a left rotation of three places, equivalent to a right shift of 23 (the shift parameter is used as the key):
Plain: Cipher:
ABCDEFGHIJKLMNOPQRSTUVWXYZ XYZABCDEFGHIJKLMNOPQRSTUVW
When encrypting, a person looks up each letter of the message in the "plain" line and writes down the corresponding letter in the "cipher" line. Deciphering is done in reverse, with a right shift of 3.
Ciphertext: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD Plaintext: the quick brown fox jumps over the lazy dog
The example given is for the cipher text "EXXEGOEXSRGI"; the plaintext is instantly recognizable by eye at a shift of four. Another way of viewing this method is that, under each letter of the cipher text, the entire alphabet is written out in reverse starting at that letter. This attack can be accelerated using a set of strips prepared with the alphabet written down them in reverse order. The strips are then aligned to form the cipher text along one row, and the plaintext should appear in one of the other rows. Another brute force approach is to match up the frequency distribution of the letters. By graphing the frequencies of letters in the cipher text, and by knowing the expected distribution of those letters in the original language of the plaintext, a human can easily spot the value of the shift by looking at the displacement of particular features of the graph. This is known as frequency analysis.
We can enhance the strength of the cipher by overcoming these 2 issues. Let us look into these 2 issues and how we can overcome them:
cipher text difficult to predict. In addition to this advantage, two similar word/phrase with different lengths would have different cipher texts. For example attackatonce and attackonce will have no pattern in common even though the word attack and once are being repeated. This happens because the string length is different thus the shift index will be different.
I MPLEMENTATION
Enhanced Caesar cipher can be implemented in following manner: 1. 2. 3. 4. Determine the shift index on the basis of string length. Determine the position of character to be replaced in the shuffled string. Add the shift index to the position to determine the position of new character. Determine the character at new position. If the new position is more than the length of the shuffled set then loop again after the loop index reaches the length of shuffled set. For example
The plain text to be ciphered is a merica. The shuffled subset is adwxyzefijklmnoghpqrstbcuv. The cipher for st this will be frnagyf. In this example a is substituted with e. For this substitution we 1 determine the position of a in shuffled subset. This is 1. Now we need to deter mine the shift index, which is length of string i.e. 7. Thus with a right shift of 7 ,a gives f as per the shuffled set. Similar substitution process will be applied to each character in the given word.
THE O UTCOME
An enhanced cipher technique derived from a simple substitution cipher is much effective compared to its original version.