You are on page 1of 19

Dr.

Selva Rani B

Classical Encryption Techniques

Part - I
Classical Techniques
Substitution Transposition
• Caesar Cipher • Rail fence Cipher
Dr. Selva Rani B

• Monoalphabetic Cipher • Scytale Cipher


• Playfair Cipher • Route cipher
• Hill Cipher • Columnar
• Polyalphabetic Cipher Transposition
• Double Transposition
Caesar Cipher
• Simplest and earliest known use of a substitution
cipher
• Used by Julius Caesar
Dr. Selva Rani B

• Involves replacing each letter of the alphabet with the


letter standing three places further down the alphabet
• Alphabet is wrapped around so that the letter
following Z is A
Caesar Cipher Algorithm (1/2)

• Can define transformation as:


• abcdefghijklmnopqrstuvwxyz
Dr. Selva Rani B

• DEFGHIJKLMNOPQRSTUVWXYZABC
• Mathematically give each letter a number
• abcdefghij 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
• Algorithm can be expressed as:

c  E 3, p    p  3 mod26
Caesar Cipher Algorithm(2/2)
• A shift may be of any amount, so that the general Caesar
algorithm is:
C  E k , p    p  k  mod 26
Dr. Selva Rani B

• Where k takes on a value in the range 1 to 25; the decryption


algorithm is simply:

p  Dk , C   C  k  mod 26
Brute-Force Cryptanalysis of Caesar Cipher
Monoalphabetic Cipher
• With only 25 possible keys : Caesar cipher is not secure
• Key space can be increased by arbitrary substitution
• Monoalphabetic cipher : single cipher for a single plaintext
Dr. Selva Rani B

• Each plaintext character is mapped to a fixed cipher text


character always

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

E L 0 K C M P R T Q G V A Y S F Z X U H W B N J I D
Monoalphabetic Cipher
Dr. Selva Rani B
Playfair Cipher
• Best known multiple-letter encryption cipher
• Treats digrams in the plaintext as a single unit
• Translate those units into ciphertext digrams
Dr. Selva Rani B

• Based on 5 X 5 key matrix


• Encryption is done for two letters at a time
Playfair Cipher
Key : RIVER
R I/J V E A
Dr. Selva Rani B

B C D F G

H K L M N

O P Q S T

U W X Y Z
Hill Cipher
• Developed by the mathematician Lester Hill in 1929
• Takes ‘m’ successive plaintext letters and substitutes for
them ‘m’ ciphertext letters
Dr. Selva Rani B

• Substitution is determined by ‘m’ linear equations


• Strength is that it completely hides single-letter
frequencies
• The use of a larger matrix hides more frequency
information
• Strong against a ciphertext-only attack but easily broken
with a known plaintext attack
Hill Cipher

𝑐1 = 𝑘11 𝑝1 + 𝑘12 𝑝2 + 𝑘13 𝑝3 𝑚𝑜𝑑 26


Dr. Selva Rani B

𝑐2 = 𝑘21 𝑝1 + 𝑘22 𝑝2 + 𝑘23 𝑝3 𝑚𝑜𝑑 26

𝑐3 = 𝑘31 𝑝1 + 𝑘32 𝑝2 + 𝑘33 𝑝3 𝑚𝑜𝑑 26


Hill Cipher
𝑐1 𝑘11 𝑘12 𝑘13 𝑝1
𝑐2 = 𝑘21 𝑘22 𝑘23 𝑝2 𝑚𝑜𝑑 26
𝑐3 𝑘31 𝑘32 𝑘33 𝑝3
Dr. Selva Rani B

𝐶 = 𝐾𝑃 𝑚𝑜𝑑 26
Hill Cipher Example
• Plaintext : paymoremoney
• Key :
Dr. Selva Rani B

17 17 5
21 18 21
2 2 19
(p a y) | (m o r) | (e m o) | (n e y)
(15 0 24) | ….
• Key : m i r r o r
• M=3
Dr. Selva Rani B

𝑚 𝑖 𝑟
• 𝑟 𝑜 𝑟
𝑥 𝑦 𝑧
Hill Cipher - Decryption
• 𝐶 = 𝐸𝐾 𝑃 = 𝐾𝑃 𝑚𝑜𝑑 26
• 𝑃 = 𝐷𝐾 𝐶 = 𝐾 −1 𝐶 𝑚𝑜𝑑 26 = 𝐾 −1 𝐾𝑃 = 𝑃
Dr. Selva Rani B

4 9 15
• 𝐾 −1 = 15 17 6
24 0 17
Polyalphabetic Cipher – Vigenere Cipher
• Use different Monoalphabetic substitutions
• Encryption :
• Key : Row (x)
Dr. Selva Rani B

• Plaintext : Column (y)


• Ciphertext : Intersection of x and y
• Decryption :
• Key : Row (x)
• Ciphertext : Column (y)
• Plaintext : Intersection of x and y
Polyalphabetic Cipher
Dr. Selva Rani B
Polyalphabetic Cipher – Vernam Cipher
• Works on binary data rather than alphabets
• Encryption :
• Bitwise XOR of the plaintext and the key
Dr. Selva Rani B

• 𝑐𝑖 = 𝑝𝑖 ⊕ 𝑘𝑖
• Decryption :
• Bitwise XOR of the ciphertext and the key
• 𝑝𝑖 = 𝑐𝑖 ⊕ 𝑘𝑖

You might also like