Chapter 2
Chapter 2
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:-
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
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