0% found this document useful (0 votes)
13 views71 pages

Chapter 2

Chapter 2 discusses traditional symmetric key ciphers, detailing the symmetric cipher model which includes plaintext, encryption algorithm, secret key, ciphertext, and decryption algorithm. It outlines the advantages and disadvantages of symmetric-key cryptography, classical encryption techniques such as substitution and transposition ciphers, and specific examples like the Caesar cipher and Playfair cipher. Additionally, it covers cryptographic systems, cryptanalysis, and brute-force attacks.

Uploaded by

palaknadpara1812
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views71 pages

Chapter 2

Chapter 2 discusses traditional symmetric key ciphers, detailing the symmetric cipher model which includes plaintext, encryption algorithm, secret key, ciphertext, and decryption algorithm. It outlines the advantages and disadvantages of symmetric-key cryptography, classical encryption techniques such as substitution and transposition ciphers, and specific examples like the Caesar cipher and Playfair cipher. Additionally, it covers cryptographic systems, cryptanalysis, and brute-force attacks.

Uploaded by

palaknadpara1812
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 71

U & P U.

Patel Department of Computer Engineering

Chapter 2
Traditional Symmetric key cipher

Prepared by:
Dr. Sneha Padhiar
Assistant Professor,
U & P U. Patel Department of
Computer Engineering

06/04/2025 1
Symmetric cipher model
A symmetric cipher model are broadly contains five parts:-

• Plaintext: This is the original intelligible message.


• Encryption algorithm: The encryption algorithm performs various substitutions and
transformations on the plaintext. It takes in plaintext and key and gives the cipher text.
• Secret key: The key is a value independent of the plaintext and of the algorithm. Different keys
will yield different outputs.
• Cipher text: This is the scrambled message produced as output. It depends on the plaintext and
the secret key.
• Decryption algorithm: Runs on the cipher text and the key to produce the plaintext. This is
essentially the encryption algorithm run in reverse.
Two basic requirements of encryption are:
• Encryption algorithm should be strong. An attacker knowing the algorithm and
having any number of cipher text should not be able to decrypt the cipher text or
guess the key.
• The key shared by the sender and the receiver should be secret.
Advantages of Symmetric-key cryptography
• Keys for symmetric key ciphers are relatively short
• Symmetric-key ciphers can be used as primitives to construct
various cryptographic mechanisms.
• Symmetric key ciphers can be composed to produce stronger
ciphers.
Disadvantages of Symmetric-key cryptography
• Key must remain secret at both ends
• In large networks, there are many keys pairs to be managed
CLASSICAL ENCRYPTION
TECHNIQUES
Substitution Techniques

• A substitution cipher changes characters in plaintext to produce to


cipher text.
• A substitution technique is one in which the letter of plaintext are
replaced by other letter or by numbers or symbols.
• Ceasar cipher
• Monoalphabetic cipher
• Homophonic cipher
• Playfair cipher
• Hill cipher
• Polyalphabetic substitution
• One time pad
Ceasar cipher

• The encryption rule is


simple; replace each
letter of the alphabet
with the letter
standing 3 places
further down the
alphabet.
• The alphabet is
wrapped around so
that Z follows A.
CAESAR CIPHER
A B C D E F G H I J K L M N O
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
P Q R S T U V W X Y Z
15 16 17 18 19 20 21 22 23 24 25

• Plaintext: MEET ME AFTER THE PARTY


• Ciphertext: PHHW PH DIWHU WKH SDUWB

• Here, the key is 3. If different key is used, different substitution will be


obtained.
• Mathematically, starting from a=0, b=1 and so on, Caesar cipher can be
written as:
• E(p) = (p + k) mod (26)
• D(C) = (C – k) mod (26)
• ENCRYPT IT(KEY 3):
Knowledge is power

• DECRYPT IT(KEY 3):


Dwwdfn dw gdzq

06/04/2025 12
EXAMPLE
• Ciphertext: QEB NRFZH YOLTK CLU GRJMP LSBO
QEB IXWV ALD
Plaintext: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
• The transformation can be represented by aligning two alphabets;
the cipher alphabet is the plain alphabet rotated left or right by some
number of positions. For instance, here is a Caesar cipher using a
left rotation of three places, equivalent to a right shift of 23 (the shift
parameter is used as the key)

Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Cipher: XYZABCDEFGHIJKLMNOPQRSTUVW
Guess the message

06/04/2025 16
06/04/2025 17
Guess the message

06/04/2025 18
Frequency of occurance

06/04/2025 19
06/04/2025 20
06/04/2025 21
Monoalphabetic cipher
• A monoalphabetic cipher is any cipher in which the letters of the
plaintext are mapped to ciphertext letters based on a single alphabet
key. Substitution ciphers work by replacing each letter of the
plaintext with another letter. For this reason, a monoalphabetic
cipher is also called a simple substitution cipher.
• Or
• Instead of shifting alphabets by fixed amount as in Caesar cipher,
any random permutation is assigned to the alphabets. This type of
encryption is called monoalphabetic substitution cipher.
A B C D E F G H I J K L M N O
M N B V C X Z A S D F G H J K
P Q R S T U V W X Y Z
L P O I U Y T R E W Q

Plaint text= hello students


Find Cipher Text:-
Homorphonic cipher
HOMOPHONIC CIPHER
A B C D E F G H I J K L M N O
M N B V C X Z A S D F G H J K
H R P T
P B 1
P Q R S T U V W X Y Z
L P O I U Y T R E W Q
X S
T

Plain text:- Invitation


Cipher text:-
Find CIPHER TEXT
Answer
Playfair cipher
• In this technique multiple (2) letters are encrypted at a time.
• This technique uses a 5 X 5 matrix which is also called key matrix.
• Key=MONARCHY
The plaintext is encrypted two letters at a time:
1. Break the plaintext into pairs of two consecutive letters.
2. If a pair is a repeated letter, insert a filler like ‘X‘in the plaintext, eg.
"Balloon" is treated as "ba lx lo on".
3. If both letters fall in the same row of the key matrix, replace each
with the letter to its right (wrapping back to start from end), eg. “AR"
encrypts as "RM".
4. If both letters fall in the same column, replace each with the letter
below it (again wrapping to top from bottom), eg. “MU" encrypts to
"CM".
5. Otherwise each letter is replaced by the one in its row in the
column of the other letter of the pair, eg. “HS" encrypts to "BP",
and “EA" to "IM" or "JM" (as desired)
Example:

Suppose the key is DIPANI and


the plain text is MY NAME IS
fh
Cipher text:-NEEMQLZCVMBLOX
Key:-WELCOME
Polyalphabetic Substitution Cipher(vigenere)
• Each of the keys encrypts one plain text character, i.e. the first key
encrypts first plain text character, second key encrypts second plain
text character and so on.
• The main features are:
It uses a set of related monoalphabetic substitution rules
It uses a key that determines which rule is used for which
transformation
• Plaintext: THE BOY HAS THE BAG
• KEY:VIG
• PLAINTEXT:THE
• KEY: VIG
• PLAINTEXT:BOY
• KEY: VIG
• PLAINTEXT:HAS
• KEY: VIG
• PLAINTEXT:THE
• KEY: VIG
• PLAINTEXT:BAG
• KEY: VIG
A B C D E F G H I J K L M N O
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
P Q R S T U V W X Y Z
15 16 17 18 19 20 21 22 23 24 25

• KEY= DECEPTIVE DECEPT


• PLAINTEXT=WE ARE DISCOVERED
Vernam Cipher (One-Time Pad)
1. Treat each plain text alphabet as a number in an increasing
sequence, i.e. A=0, B=1,…Z=25.
2. Do the same for each character of the cipher text.
3. Add each number corresponding to the plain text alphabet to the
corresponding input cipher text alphabet number.
4. If the sum thus produced is greater than 25, subtract 26 from it.
5. Translate each number of the sum back to the corresponding
alphabet. This gives the output cipher text
• Plaintext : HOW ARE YOU
• One-Time Pad: NCBTZQARX
example
• Plaintext: COME TODAY
• KEY:NCBTZQARX
• CIPHERTEXT:
PLAINTEXT C O M E T O D A Y
2 14 12 4 19 14 3 0 24
KEY N C B T Z Q A R X
13 2 1 19 25 16 0 17 23
TOTAL
15 16 13 23 44 30 3 17 47
SUB 26 IF >
25 15 16 13 23 18 4 3 17 21
CIPHERTEXT P Q N X S E D R V
Hill Cipher

• The Hill Cipher works on multiple letters at the same time.


• The way the Hill Cipher work is as follows:
 Treat letter in the plain text as a number, i.e.
A=0,B=1,..,Z=25
 The plain text message is organizes as a matrix of
numbers, based on the above conversation. For
example, if our plain text is CAT, it will be C=2, A=0 and
T=19. Our plain text would be:
• Plaintext: paymoremoney
• Key: 17 17 5
21 18 21
2 2 19
example
• Plaintext: paymoremoney
• Key: 17 17 5
21 18 21
2 2 19

The first three letters of the plaintext are represented by the vector:
C=kp mode 26
17 17 5 15 375
11
21 18 21 * 0 mod 26 = 819 mod 26 = 13 = LNS
2 2 19 24 486 18
• CIPHERTEXT=LNSHDLEWMTRW
• ENCRYPT THE MSG:-
GOOD MORNING
THE KEY[J E F H]
• DECRYPTION requires using the inverse of the matrix K
• Plaintext P= D(K,P)=K^-1 * c mod 26 =k^-1 KP = P
AFFINE CIPHER

Plaintext=HELLO
key= (7,2)
Transposition Techniques
Rail Fence Technique
• Here, the plain text is written down as a sequence of diagonals and
then read off as a sequence of rows.
• For example, to encipher the message “meet me after the toga
party” with rail fence of depth 2, we write the following:
m e m a t r h t g p r y
e t e f e t e o a a t
• The encrypted message is
MEMATRHTGPRYETEFETEOAAT
Simple Columnar Transposition Technique
• A more complex scheme is simple columnar Transposition
• It is to write the message in a rectangle , row by row, and read the
message off, column by column, but permute the order of columns.
• The order of the columns then becomes the key to the algorithm,
EXAMPLE
Plain text: attack postpones until two am
Key: 4312567
THE BOOK IS SUITABLE FOR SELF STUDY

KEY= 564132
Cryptography
• Cryptographic systems are characterized along three main dimensions:
• The type of operations used for transforming plaintext to ciphertext :
Substitution, in which each element in the plaintext is mapped into another element
Transposition, in which each element in the plaintext are rearranged
• The number of keys:
Same key-Symmetric and Different keys-Asymmetric (Public-key encryption)
• The way in which the plaintext is processed:
A block cipher processes the input one block of elements at a time, producing an
output block for each input block.
A stream cipher processes the input elements continuously, producing output one
element at a time
Cryptanalysis and Brute-Force Attack
• Cryptanalysis:
It relies on the nature of the algorithm plus perhaps some knowledge
of the general characteristics of the plaintext even some sample
plaintext-ciphertext pairs. It exploits the characteristics of the
algorithm to attempt to deduce a specific plaintext or to deduce key
being used.
• Brute-force attack:
The attacker tries every possible key on a piece of ciphertext until an
intelligible translation into plaintext is obtained.
• The following table summarize the various types of cryptanalytic
attacks based on the amount of information known to the
cryptanalyst:
• Statistical attack
• Pattern attack
LMS APPLICATION FOR YOUR REFERENCE
https://play.google.com/store/apps/details?id=com.Cryptos.cryptos
Questions

You might also like