Professional Documents
Culture Documents
CH 3
CH 3
Lecture Notes
2
Cryptography and Encryption Techniques
3.1 Introduction
Cryptography has five ingredients
◦ Plaintext: the original message that is fed into the algorithm as input
◦ Encryption algorithm: performs various substitutions and transformations
on the plaintext
◦ Secret Key: is also input to the algorithm; the exact substitutions and
transformations performed by the algorithm depend on the key; larger key
size means greater security but may decrease encryption/decryption speed
◦ Cipher text: the scrambled message produced as output. It depends on the
plaintext and the secret key; for a given message, two different keys will
produce two different cipher texts
◦ Decryption algorithm: the encryption algorithm run in reverse. It takes the
cipher text and the same secret key (in symmetric key cryptography) and
produces the original plaintext 3
Cryptography and Encryption Techniques
3.1 Introduction
Simplified Symmetric Encryption Model
5
Cryptography and Encryption Techniques
3.1 Introduction
Notation
◦ Given
P = Plaintext
C = Ciphertext
◦ C = EK(P) Encryption
◦ P = DK (C) Decryption
⇒P = DK (EK (P))
⇒C = EK (DK (C))
6
Cryptography and Encryption Techniques
3.1 Introduction
•Types of Cryptography
Mainly classified into two types :
1. Symmetric key cryptography
2. Asymmetric key cryptography
Cryptography
Plain Text N O P Q R S T U V W X Y Z
Cipher Text Q R S T U V W X Y Z A B C
Cryptography and Encryption Techniques
3.2 Symmetric key Cryptography
Monoalphabetic Cipher substitution technique:
• Caesar cipher is far from secure, it can be easily break by brute-force
cryptanalysis because of the key space are small: Simply try all
possible keys. All possible keys are 26.
• It uses fixed substitution over the entire message
• Uses random substitution
• Requires permutation or combination of 26 alphabets / 26! = possible
keys.
• Eliminate brute-force techniques for cryptanalysis
• Example encryption of the alphabet is given bellow
Plain text A B C D E F G H I j k l m
Cipher text Y N L K X B S H M I W D P
Plain Text N O P Q R S T U V W X Y Z
Cipher Text J R O Q V F E A U G T Z C
Cryptography and Encryption Techniques
3.2 Symmetric key Cryptography
Playfair Cipher substitution technique:
• The best-known multiple-letter encryption cipher, which treats
diagrams in the plaintext as single units and translate these into cipher
diagrams.
• Algorithm is based on the use of 5 × 5 matrix of letters constructed
using a keyword.
• Example, solved by lord peter Wismsey in Dorthy Sayers’s have his
Carcase. M O N A R
C H Y B D
E F G I/J K
L P Q S T
U V W X Z
23
Cryptography and Encryption Techniques
3.2 Symmetric key Cryptography
Rail-Fence technique
• The simple transposition techniques which involves writing plain text
as a sequence of diagonals and then reading it row to produce the
cipher text. Algorithm works as follows:
Step 1: Write down all the characters of plaintext message in a sequence
of diagonals
Step 2: Read the plaintext in step 1 as a sequence of rows.
E.g. create a cipher text from “corporate bridge” plain text.
First, we arrange the plaintext in a sequence of diagonal as :
Decide the column order for reading the message – let’s assume 1,3,5,2,4,6 is
an order.
Now read the message in a columnar manner using the decided order. –
cadreeorotgpbri cadreeorotgpbri is a cipher text.
Cryptography and Encryption Techniques
3.2 Symmetric key Cryptography
Simple columnar transposition techniques
The simple columnar transposition technique can be categorized into two
parts – Basic technique and multiple rounds.
Simples columnar transposition technique – basic technique. The simple
columnar transposition technique simply arranges the plain text in a
sequence of rows of a rectangle and reads it in a columnar manner.
How does this algorithm work?
Step 1: Write all the characters of plain text message row by row in a
rectangle of predefined size.
Step 2: Read the message in a columnar manner i.e. column by column.
Note: For reading the message, it needs not to be in the order of columns. It
can by any random sequence.
Step 3: The resultant message is cipher text.
Cryptography and Encryption Techniques
3.2 Symmetric key Cryptography
Vernam Cipher
A subset of Vernam cipher is called a one-time pad because it is implemented
using a random set of nonrepeating characters as an input cipher text.
Note: Once the input cipher text is used for transposition, it never used for any
other message. The length of input ciphertext must be equal to the length of
plain text.
Working of Algorithm
Step 1: Arrange all characters in the plain text as a number i.e. A = 0, B = 1,
….. Z = 25.
Step 2: Repeat the same procedure for all characters of the input ciphertext.
Step 3: Add each number corresponding to the plain text characters to the
corresponding input ciphertext character number.
Step 4: If the sum of the number is greater than 25, subtract 26 from it.
Step 5: Translate each number of the sum into the corresponding characters.
Cryptography and Encryption Techniques
3.2 Symmetric key Cryptography
Vernam Cipher cont..
In Vernam cipher, once the input cipher text is used, it will never be used for any other message, hence it
is suitable only for short messages.
Example: The plain text is educba and cipher text is ntcbar
Symmetric key Cryptography(modern)
DES
29
Cryptography and Encryption Techniques
3.2 Asymmetric key Cryptography