Caeser Cipher
It is the simplest technique found by Julius Caesar.
It is a substitution cipher technique.
In this method, each character of a plaintext message is replaced by a character three
position down in the alphabet to get the cipher text message.
Write down A TO Z alphabets and give value to it starting from 0
A 0
B 1
C 2
D 3
E 4
F 5
G 6
H 7
I 8
J 9
K 10
L 11
M 12
N 13
O 14
P 15
Q 16
R 17
S 18
T 19
U 20
V 21
W 22
X 23
Y 24
Z 25
Table 1
Now as the method says each character of a plaintext message is replaced by a character
three position down in the alphabet to get the cipher text message.
We can define the transformation by listing all possibilities, as follows
Plain text
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
Cipher text
D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
For example:
If plaintext is aarush and bhagya Cipher
text is DDUXVK DQEKDJBD
So, by adding 3 as a key, you can encrypt your plaintext into cipher text and by
subtracting 3 from cipher text you can get back the plaintext.
- We can represent the Caesar cipher mathematically as:
- FOR Encryption
C = E (3 , P) = (P + 3) mod 26
(Where C is cipher text, P is plaintext, E IS Encryption)
And for decryption we can write:
P = D (3, C) = (C – 3) mod 26
(Where C is cipher text, P is plaintext, D is Decryption)
A more general version of this cipher is:
C = E( k, p ) = (p + k) mod 26 and P = E(3 , c) = (c – k) mod 26
How to find mod??
Eg find 10mod26
Step1 first divide 10/26=0.384615385
Step2 then see the answer obtained in step 1 take the no before . point that is 0 now subtract
0.384615385-0= 0.384615385
Step 3 multiply the obtained answer from step 2 with 26 0.384615385*26=10
The obtained answer is 10mod26=10
EXAMPLES
1) The given plain text is Hello Word then find out the cipher text .
Plain text = HELLO WORLD
Cipher text = KHOOR ZRUOG
2) The given plain text is YES do the encryption and decryption of plain text
mathematically
Plain text = YES
find Y=24 E=4 S=18 from table 1
Now write down the encryption formula to obtain the cipher text
C = E= (3 , P) = (P + 3) mod 26
C=(P+3)mod 26
=(Y(24) +3) mod26
= 27mod26
=1
=B
C=(P+3)mod 26
= (E(4) +3) mod26
= 7mod26
=7
=H
C=(P+3)mod 26
= (S(18) +3) mod26
= 21mod26
= 21
=V
So the obtained cipher text is BHV
Plain text = YES
Cipher text= BHV
NOW for decryption
P = D (3, C) = (C – 3) mod 26
Cipher text = BHU B=1 H=7 V=21 from table 1
P=(C-3)mod26
=(B(1)-3)mod26
= -2mod 26
Now if the ans is in – then subtract it with 26 that is 26-2=24
So now take 24 instead of -2
24mod26
=24
=Y
P=(C-3)mod26
=(H(7)-3)mod26
= 4mod 26
=4
=E
P=(C-3)mod26
=(V(21)-3)mod26
= 18mod 26
= 18
=S
SO the obtained plain text is YES
Cipher text = BHV
Plain text = YES
Advantages of Caesar cipher
It is easy to use.
Its working fast.
Disadvantages Caesar cipher
It has simple structure. The encryption and decryption algorithms are
known.
There are only 25 keys to try.
Brute force attack can be done on it easily.
Note: Caesar cipher is the simplest form of “shift cipher”.
Shift cipher is a type of substitution cipher in which each letter in the
plaintext is replaced by a letter some fixed number of positions up or
down the alphabet. For example, with a leftshift of 3, D would be
replaced by A, E would become B, and so on.
In case of Caesar cipher encryption, we are replacing our plaintext
letter by shifting three letters ahead.
Questions
1) Find out the cipher text of your name
2) Find out the cipher text of “ Network Security”
3) Do the encryption and Decryption mathematically of the plain text “BOX”