In cryptography, substitution is a technique in which plaintext letters are replaced with other letters, numbers, or symbols. Substitution includes substituting plaintext bit patterns with ciphertext bit patterns if the plaintext is considered as a sequence of bits. Caesar Cipher is one of the substitution techniques first used by Julius Caesar.
Caesar Cipher
The Caesar cipher includes substituting each letter of the alphabet according to the positions of the key values down the alphabet. It is also known as additive cipher.
- For Encryption Formula for this technique:
- C = E(K, P) mod 26 = E(K+P) mod 26
- For Decryption Formula for this technique:
- P = D(C,K) mod 26 = D(C-K) mod 26
Where:
- C is Cipher Text
- E is for encryption
- K is Key
- P is Plain Text
- D is for Decryption
Each letter is assigned a numeric value from 0 to 25 and the key values lies between 1 to 25 as
1<= k <= 25 & letters are assigned numeric values as
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 |
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
Example Based on Technique:
Q.1 Use Caesar Cipher with the key = 12 to encrypt the message “EASYTECHNOTES”
Ans1: we are applying an encryption algorithm to the plaintext, character by character to convert it into the ciphertext or in the coded form.
Plaintext E - 04 Encryption - (12+04) mod 26 Ciphertext 16 - Q Plaintext A - 00 Encryption - (12+00) mod 26 Ciphertext 12 - M Plaintext S - 18 Encryption - (12+18) mod 26 Ciphertext 04 - E Plaintext Y - 24 Encryption - (12+24) mod 26 Ciphertext 10 - K Plaintext T - 19 Encryption - (12+19) mod 26 Ciphertext 05 - F Plaintext E - 04 Encryption - (12+04) mod 26 Ciphertext 16 - Q Plaintext C - 02 Encryption - (12+02) mod 26 Ciphertext 14 - O Plaintext H - 07 Encryption - (12+07) mod 26 Ciphertext 19 - T Plaintext N - 13 Encryption - (12+13) mod 26 Ciphertext 25 - Z Plaintext O - 14 Encryption - (12+14) mod 26 Ciphertext 00 - A Plaintext T - 19 Encryption - (12+19) mod 26 Ciphertext 05 - F Plaintext E - 04 Encryption - (12+04) mod 26 Ciphertext 16 - Q Plaintext S - 18 Encryption - (12+18) mod 26 Ciphertext 04 - E
so, the encoded ciphertext of the plaintext “EASYTECHNOTES” is “QMEKFQOTZAFQE”
Q.2 Use Caesar Cipher with the key = 12 to decrypt “QMEKFQOTZAFQE”
Ans 2: we are applying a decryption algorithm to the ciphertext, character by character to convert it into plain text or to see the original message.
Ciphertext Q - 16 Decryption - (16-12) mod 26 Plaintext 04 - E Ciphertext M - 12 Decryption - (12-12) mod 26 Plaintext 00 - A Ciphertext E - 04 Decryption - (04-12) mod 26 Plaintext 18 - S ((04-12)mod 26 = -8 became 18(-8+26) according to modulo 26)) Ciphertext K - 10 Decryption - (10-12) mod 26 Plaintext 24 - Y ((10-12)mod 26 = -2 became 24(-2+26) according to modulo 26)) Ciphertext F - 05 Decryption - (05-12) mod 26 Plaintext 19 - T ((05-12)mod 26 = -7 became 19(-7+26) according to modulo 26)) Ciphertext Q - 16 Decryption - (16-12) mod 26 Plaintext 04 - E Ciphertext O - 14 Decryption - (14-12) mod 26 Plaintext 02 - C Ciphertext T - 19 Decryption - (19-12) mod 26 Plaintext 07 - H Ciphertext Z - 25 Decryption - (25-12) mod 26 Plaintext 13 - N Ciphertext A - 00 Decryption - (00-12) mod 26 Plaintext 14 - O ((00-12)mod 26 = -12 became 14(-12+26) according to modulo 26)) Ciphertext F - 05 Decryption - (05-12) mod 26 Plaintext 19 - T ((05-12)mod 26 = -7 became 19(-7+26) according to modulo 26)) Ciphertext Q - 16 Decryption - (16-12) mod 26 Plaintext 04 - E Ciphertext E - 04 Decryption - (04-12) mod 26 Plaintext 04 - S ((04-12)mod 26 = -8 became 18(-8+26) according to modulo 26))
So, the decrypted text is “EASYTECHNOTES”. Note: The operation is in modulo 26, which means the negative result is to be mapped with modulo 26 according to modular arithmetic as shown above.
Discover more from easytechnotes
Subscribe to get the latest posts sent to your email.