3. Symmetric Key Cryptography
• Same key is used for encryption and decryption is called symmetric key cryptography. It
is also known as secret key cryptography.
•
• Elements of Symmetric Key Cryptography
• Plaintext is the original message or data that is fed into the algorithm as input.
• Encryption algorithm performs various substitutions and transformations on the
plaintext.
• Secret key is a value independent of the plaintext and of the algorithm. The exact
substitutions and transformations performed by the algorithm depend on the key.
• Ciphertext is the unreadable message produced as output. It depends on the plain text
and secret key.
• Decryption algorithm takes the cipher text and the secret key and produces the original
plain text.
4. Symmetric Key Cryptography
• Same key is used for encryption and decryption process. So, it is
called symmetric cipher.
Figure: Symmetric Key Cryptography
5. Symmetric Key Cryptography
Mathematically it is represented as
For Encryption, Y = E (K, X)
For Decryption, X = D (K, Y)
where Y = Cipher text, X = Plain Text, E = encryption, D = Decryption, K = Secret shared key.
For example, Data Encryption Standards (DES), Advanced Encryption Standards (AES) and
BLOWFISH.
6. Types of symmetric cipher
There are basically two types of symmetric cipher: Substitution Cipher,
Transposition Cipher.
Substitution Cipher: A substitution is a technique in which each letter or bit of
the plaintext is substituted or replaced by some other letter, number or
symbol to produce cipher text. For Example, ABC ⟹ XYZ.
Types of Substitution Cipher: Caesar Cipher, Monoalphabetic Cipher, Vigenère
Cipher, Playfair Cipher, One time pad cipher (Vernam cipher), Hill Cipher.
Transposition Cipher: In transposition technique, there is no replacement of
alphabets or numbers occurs instead their positions are changed or reordering
of position of plain text is done to produce cipher text. For Example,
ABCDE ⟹ BADEC.
Types of Transposition Cipher: Rail Fence Cipher, Columnar Transposition Cipher.
7. Caesar cipher
• Caesar cipher is type of substitution cipher.
• This technique was found by Julius Caesar.
• This technique is very simple and easy to generate cipher of given
plain text.
• This technique is also known as shift cipher.
8. Caesar cipher
• Step-1: The encryption can also be represented using modular
arithmetic by first transforming the letters into numbers, according to
the scheme, a = 0, b= 1, ..., z = 25. Encryption of a letter (C) by a shift
(E)can be described mathematically.
• Generalise equation of Caesar cipher (Encryption & Decryption):
• C = E (K, P) = (P + K) mod 26
• P = D (K, C) = (C – K) mod 26
• Where, C = Ciphertext, P = Plain Text, E = Encryption, D = Decryption,
K = Key.
9. Caesar cipher
• Step-2: The transformation can be represented by aligning two
alphabets; the cipher alphabet is the plain alphabet shift left or right
by some number of positions. For instance, here is a Caesar cipher
using a shifted of three places. (Here key is 3).
11. Monoalphabetic and polyalphabetic
• Monoalphabetic and polyalphabetic both are types of substitution
cipher.
• Monoalphabetic cipher: It is a technique in which only one character
convert from plain text to cipher text.
• For example, Caesar cipher.
• Polyalphabetic Cipher: It is a technique in which more than one
(multiple) character convert from plain text to cipher text.
• For example, Playfair cipher, Vigenère cipher, hill cipher, one time pad
cipher.
12. Playfair Cipher
• Playfair cipher is type of substitution cipher.
• It is also called polyalphabetic substitution cipher.
• In this cipher techniques, more than one character is used during
encryption/decryption. So, this cipher technique is called multiple
substitution cipher technique.
• Input of this technique are keyword and plain text.
• Keyword is one type of string.
13. Playfair Cipher
• Rules of encryption is as follows:
• Step-1: Construct 5x5 matrix of given keyword(key). The letter “I” and
“J” will be consider as one letter. So, if “I” is already placed then no
need to place “J” in rest of matrix. (Or write I/J).
• For Example, Keyword = MONARCHY
14. • Step-2: If any characters are to be repeated in given keyword, used it
only once during matrix filling.
• For Example, Keyword = PLAYFAIR
Playfair Cipher
15. Playfair Cipher
• Step-3: Plain text is broken down into groups of two alphabets. There are two
possibilities.
• Possibility-1: Plain text message that we want to encrypt broken down into groups of two
alphabets. (Make pair of two alphabets of given plain text)
• For Example, MY NAME IS MAHI
• Plain text: MY NA ME IS MA HI
• Possibility-2: If both alphabets are the same (or only one is left) in plain text, add an X
after the first alphabet. Encrypt the new pair and continue.
• For Example, GREEN
• Plain text: GR EX EN
• For Example, NETWORK
• Plain text: NE TW OR KX
• Step-4: When pair of plain text will be encrypt using matrix, there are 3 possibilities.
16. Playfair Cipher
• Possibility-1: If the alphabets are not in the same row or column,
replace them with the alphabets in the same row respectively, but at
the other pair of corners of the rectangle defined by the original pair.
17. Playfair Cipher
• Possibility-2: If both the alphabets in the pair appear in the same row
of matrix, replace them with alphabets to their immediate
right respectively.
• If the original pair is on the right side of the row,
then wrapping around to the left side of the row happens.
18. Playfair Cipher
• Possibility-3: If both alphabets in the pair appear in the same column
of matrix, replace them with alphabets immediate below from
respectively.
• If the original pair is on the bottom side of the column, then wrapping
around to the top side of the column happens.
19. Vigenère Cipher
• Vigenère Cipher is a method of encrypting alphabetic text.
• It uses a simple form of polyalphabetic substitution.
• A polyalphabetic cipher is any cipher based on substitution, using
multiple substitution alphabets.
• The encryption of the original text is done using the Vigenère square
or Vigenère table.
• The table consists of the alphabets written out 26 times in different
rows, each alphabet shifted cyclically to the left compared to the
previous alphabet.
21. Vigenère Cipher
• Rules of encryption is as follows:
• Step-1: Create Vigenère table as per your given keyword. (If Vigenère
table is not given). Given keyword arrange in alphabetical order then
create table as per given below.
22. Vigenère Cipher
• Step-2: First row represents Plain Text and First
column represents Keyword in Vigenère table.
23. Vigenère Cipher
• Step-3: In Keyword length is lesser than given plain text then repeat
keyword alphabets until it matches the length of plain text.
24. Vigenère Cipher
• Step-4: The first letter of the plaintext, “I” is paired with “M”, the first
letter of the key. So, use row “M” and column “I” of the Vigenère
table, it produces cipher text “U” and so on.
25. One Time Pad Cipher
• One-time pad (OTP), also called Vernam-cipher or the perfect cipher,
is a crypto algorithm where plaintext is combined with a random key.
• The key is at least as long as the message or data that must be
encrypted.
• Each key is used only once, and both sender and receiver must
destroy their key after use.
• There should only be two copies of the key: one for the sender and
one for the receiver.
26. One Time Pad Cipher
• Rules of encryption is as follows
• Step-1: Assign a number to each character like (a = 0, b = 1, c = 2, … z
= 25). As per given table.
27. One Time Pad Cipher
• Step-2: Assign a number to each character of plain text and key
according to alphabetical order. (From table of step-1)
28. One Time Pad Cipher
• Step-3: Add both the number (Corresponding plain-text character
number and Key character number).
29. One Time Pad Cipher
• Step-4: Subtract the number from 26 if the added number is greater
than 26. otherwise left it. Assign alphabets of numbers, it produces
cipher text.