Crypto system:
A crypto system consists of encryption algorithm which transforms plaintext into
ciphertext and decryption algorithm which transforms the ciphertext into the
plaintext.
Encryption and decryption algorithms are collectively referred to as ciphers. Ciphers
use codes called keys in their encrypt and decrypt functions.
Depending on the secrecy and number of keys, cryptosystems is divided into 2
categories:
1. Symmetric Key (private key/ single key/ secret key cryptosystems.)
2. Asymmetric key or Public key
In symmetric key cryptosystems, the same key is used by both the
encryption and decryption functions .
Substitution cipher divided into 2 categories :
1. Mono-alphabetic: Fixed substitution strategy. If a->e , then through out the
plain text all the a will turn to e
2. Poly-alphabetic: variable substitution. Substitution for plaintext alphabet can
be different depending upon its position.
Substitution Ciphers:
Caesar or Shift Cipher (Mono-alphabetic)
Encryption consists of shifting each letter of the plaintext m by k letters to the right,
where k is the secret key. • For example, if k=2, A transforms to C, B transforms to
D, …., Z transforms to B (wrapround).
Can k be a negative integer between -1 and -25? Yes – in this case the encryption
just shifts the character to the left and the decryption shifts it to the right.
Vigenere Cipher (Poly-alphabetic)
The Vigenere table consists of a symmetric matrix of alphabet in which each row
(and each column) shifts the alphabet by one position.
The key is a string of letters. If the message size is larger than the key size, the key
is repeated to form a key sequence.
Encryption Algorithm: The ciphertext character c (i) is the character at the
intersection of the row (m(i)) and column (k (i)).
Decryption Algorithm: Start at row k(i), proceed until you find c(i) in that row, and
read m(i) at the top of the column.
Playfair Cipher (Poly-aplhabetic)
First a key matrix is produced. Suppose the secret key is SECURITY, the letters of
the key are written row-wise in a 5X5 matrix. After the key letters are filled, the
remaining letters (J is in the same box as I) of the alphabet are used to fill the key
matrix.
Secret key= security
Row/ 1 2 3 4 5
Column
1 s e c u r
2 i t y a b
3 d f g h k
4 l m n o p
5 q v w x z
Step 1: Divide the plain text into pairs of letters. If letters is not even, z is added as
padding. Repeated letters are replaced with X or Q
Suppose message
m= come quickly we need help
Breaking m into pairs
co me qu ic kl yw en ex ed he lp
Step 2: Each pair will be replaced by another pair fro the key matrix.
Rule of replacing:
If 2 letters appear at the same column, replace with immediately below(wrap
around)
If 2 letters appear at the same row, replace with immediately right(wrap
around)
If 2 letters appear at different rows and columns, form a rectangle and
replace with the letter with what is at the opposite side of the corner,
For example, EH will become UF
Secret key k=security
co me qu ic kl yw en ex ed he lp
un vt xs ys dp gc cm uv sf fu ml
Transposition Cipher:
Rail Fence Cipher:
Matrix Transposition Cipher: