Lecture 3
Lecture 3
LECTURE 3
Elementary / Traditional
Cryptography
• Substitution Ciphers, and
• Transposition Ciphers
Substitution Ciphers & Transposition Ciphers
Substitution Ciphers:
• Each letter or group of letters is replaced by another letter or group of letters
• The plain alphabet rotated left or right by some number of positions.
• Every occurrence of one character will be substituted with the same replacement
character, while its position remains unchanged.
Transposition Cipher Technique:
• Rearranges the position of the plain text’s characters. The position of the character
is changed but character’s identity is not changed.
• Transposition cipher is a type of encryption technique where the positions of the
letters in the plaintext message are rearranged to form a ciphertext message. This
technique does not alter the letters themselves but rather the order in which they
appear.
Substitution Cipher
Monoalphabetic Polyalphabetic
1- Caesar Cipher:
• Also known as, Caesar's code or Caesar shift:
• Is one of the simplest and most widely known
Encryption techniques.
cipher X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
Substitution Ciphers
Exercise: use Caesar Cipher method to encrypt
“ computer science”, with key = left shift by 8
characters
Alphabet 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
the order 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 26
answer: ???
plaintext c o m p u t e r s c i e n c e
ciphertext
Substitution Ciphers & Transposition Ciphers
2- Mono Alphabetic Substitution Cipher
• Relationship between ciphertext symbol and
plaintext symbol is 1:1
• Key value is added to plain text and numeric value
of key ranges from 0 – 25
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
Where: P=Plaintext
C=Ciphertext k=key
2- Mono Alphabetic Substitution Cipher
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
C= MJQQT P= HELLO
Implementation of Mono Alphabetic Substitution Cipher
3-Polyalphabetic substitution cipher
“Vigener cipher”
Plaintext J A V A T P O I N T
Plaintext
09 00 21 00 19 15 14 08 13 19
value (P)
Key B E S T B E S T B E
Key value
01 04 18 19 01 04 18 19 01 04
(K)
Ciphertext
10 04 13 19 20 19 06 01 14 23
value (E)
Ciphertext K E N T U T G B O X
3-Polyalphabetic substitution cipher “Vigener cipher”
Ciphertext K E N T U T G B O X
Ciphertext
10 04 13 19 20 19 06 01 14 23
value (E)
Key B E S T B E S T B E
Key value
01 04 18 19 01 04 18 19 01 04
(K)
Plaintext
09 00 21 00 19 15 14 08 13 19
value (P)
Plaintext J A V A T P O I N T
Vigenere Table
T U O R I
A L S B C
V W X Y Z
4-Playfair Cipher
Plaintext: HI DE MO NE YZ
T U O R I
A L S B C
‘D’ and ‘E’ are in same row
D E F G H
DE → EF
K M N P Q
V W X Y Z
4-Playfair Cipher
Using these rules, the result of the encryption of “hide money” with
the key of ‘tutorials’ would be:
QC EF NU MF ZV
Decrypting:
• The Playfair cipher is as simple as doing the same
process in reverse.
• Receiver has the same key and can create the same
key table, and then decrypt any messages made using
that key.
Cipher Text: "gatlmzclrqtx"
Decrypted Text: instrumentsz Decryption Process
Key text: Monarchy