Chapter 2 DES Handwritten
Chapter 2 DES Handwritten
confusion
➔ Given cipher text , we shldnt be able to guess the plain text or key or other details
➔ An example of a method possessing confusion property is substitution
Diffusion
➔ The process of making each plaintext bit affect as many ciphertext as possible
➔ Suppose u r giving some plaintext to the cipher or encryption algorithm and this is
generating the ciphertext which is the output and if u make a small modification in the
plain text and the output or the ciphertext is changed drastically , then there is diffusion
property
Both
Stream cipher
➔
➔ If the encryption is done bit by bit or byte by byte -→ stream cipher
➔ The output also ll be produced in bit or byte
➔ 2 inputs → plain text and key
Block cipher
➔ Operates in block by block / fixed length group of bits (64 bit /128bit..)
➔ The size of the block is decided by the encryption algo
➔
→Most symmetric block encryption algorithms in current use are based on a structure referred
to as a Feistel block cipher. A block cipher operates on a plaintext block of n bits to produce a
ciphertext block of n bits. An arbitrary reversible substitution cipher for a large block size is not
practical, however, from an implementation and performance point of view. In general, for an n-
bit general substitution block cipher, the size of the key is n x 2n. For a 64-bit block, which is a
desirable length to thwart statistical attacks, the key size is 64x 264 = 270 = 1021 bits. In
considering these difficulties, Feistel points out that what is needed is an approximation to the
ideal block cipher system for large n, built up out of components that are easily realizable.
Differences between stream and block cipher
design
s.t→ complex →uses a complex design cuz it takes a input bit and ll generate a output bit
➢ A: 2 characters
➢ S-P nets are based on the two primitive cryptographic operations seen before:
⚫ substitution (S-box)
⚫ permutation (P-box)
In particular, Feistel proposed the use of a cipher that alternates substitutions and
permutations, as a practical application of a proposal by Claude Shannon. Claude Shannon’s
1949 paper has the key ideas that led to the development of modern block ciphers. Critically, it
was the technique of layering groups of S-boxes separated by a larger P-box to form the S-P
network, a complex form of a product cipher. He also introduced the ideas of confusion and
diffusion, notionally provided by S-boxes and P-boxes (in conjunction with S-boxes).
more practically Shannon suggested combining S & P elements to obtain:
The terms diffusion and confusion were introduced by Claude Shannon to capture the two basic
building blocks for any cryptographic system.
Shannon's concern was to thwart cryptanalysis based on statistical analysis. Every block cipher
involves a transformation of a block of plaintext into a block of ciphertext, where the
transformation depends on the key.
The mechanism of diffusion seeks to make the statistical relationship between the plaintext
and ciphertext as complex as possible in order to thwart attempts to deduce the key.
Confusion seeks to make the relationship between the statistics of the ciphertext and the value
of the encryption key as complex as possible, again to thwart attempts to discover the key.
So successful are diffusion and confusion in capturing the essence of the desired attributes of a
block cipher that they have become the cornerstone of modern block cipher design.
➔ The plaintext is divided into two parts ( left hand side and right hand side)
➔ Example : if plaintext is 64bit ( lhs will be 32 bit and rhs bit ll 32 bit)
➔ Why spliiting?
The rhs is given to some function and it is computed with the help of the key k1
and the output of this is xored with lhs
➔ For every round , you use different keys ( totally 16 rounds+ 1 round (Swap))
➔ At last , you swap
➔
Decryption process
➔ So for creating confusion and diffusion properties for cipher text , something must be
carried out ( ciphertext needs confusion and diffusion)
➔ The function F is responsible for creating this confusion and diffusion properties ,
1. Substitution
2. Permutation
1.block size
2.key size
➔ What is the original key size and what is generated round key size
➔ If we need greater security → use greater length key size
➔ But if we use bigger key size → it may decrease encryption / decryption speed
➔ If key size is smaller → it is vulnerable to brute force attack and leads to lesser
confusion
1. Greater confusion
2. Greter diffusion
3. High security
3.Number of rounds
5.round function
→there shld be complex design in the round function to gain both confusion and diffusion
properties
7.ease of analysis
→in cryptanalyst perspective, it shld nt be easy for them to analyze entire process
The exact realization of a Feistel network depends on the choice of the following parameters
and design features:
• key size - increasing size improves security, makes exhaustive key searching harder, but
may slow cipher
• subkey generation algorithm - greater complexity can make analysis harder, but slows
cipher
• round function - greater complexity can make analysis harder, but slows cipher
➔
➔ The input is plain text ( 64 bits)
➔ The subkey helps to generate round key
➔ No of round keys = 16 – 48bit round keys
➔
➔
→”initial permutation function”-→ takes 64bit pplain text and changes the position of bits
and gives 64bit output
➔ 64 bit is the original key → round key 48 bit generate aagum from 56 bit subkey
→ takes 64bit pplain text and changes the position of bits and gives 64bit output
➔ Left hand image : input 64 bit binary format
➔ Rhs image : output after changing position of bits
→
Inverse initial permutation arrangement is → first row is permuatated (reordering) to 2nd
column
“mangler function"
Output: Li and Ri
Mangler function
1.expnsion permutation
3.s box
4.p box
Original 32 bit rhs
These bits from input is placed here
So the expansion permutation function takes 32 bit input and produces 48 bit output
➔ We have 8 s -boxes
➔ 48 bits input /8 s-boxes = 6 bits each (input)
➔ The output of each s box is 4 bits
➔ Total output of s box will be 32 bits
➔
➔ This follows the classic structure for a feistel cipher.
➔ Note that the s-boxes provide the “confusion” of data and key values, whilst the
permutation P then spreads this as widely as possible, so each S-box output affects
as many S-box inputs in the next round as possible, giving “diffusion”.
➔
How 6 bits are converted into 4 bits?
Encryption
Permutated choice 1
Permutaed choice 2
➔ Reverse of encryption
➔ Input: cipher text and output : plain text
➔ Order of round keys is changed
➔ In round 1 → key16 k16 is used
➔
Avalanche Effect and the Strength of DES
➔ Suppose u r modifying 1 bit in plain text / key , it leads to drastic change in cipher
text when comparing previous cipher text→ this is avalanche effect→ then this
exhibit strong avalanche effect
➔ Suppose 1 bit is changed in plain text /key and only 2 to 3 bits are changing in
cipher text (not changing drastically), then it gives room for cryptanalyst to know
the pattern
➔ If there is 1 bit modification in input plain text / key , there shld be many no of bits
change in the output → if any encryption algo has that property then that has
avalanche effect
➔ How ?
Strength of des
1.use of keys
→ the original key size is 64 bit and the effective length is 56 bit which is converted
→exactvalue :
→ then is brute force attack possible (attempting all possible keys to know the key) ?
→if the keyspace is 10 keys → lkeep trying → one point successful
→has lot of components like swap function ,permutation function ,andha table , indha
table
➔ As s boxes were kept private → they wd have guuesed some clue is in there nu
3.Timing attacks
➔ An attack that gives some info abt the key or the plaintext
➔ 2nd point → this gives some idea abt nature of encryption process
➔ Timing attack ll reveal some info abt encryption and decryption
➔ Des is fairly resistant to timing attack
➔
Des -solved questions
Search entire keyspace → brute force attack
Refer thangaramya 10 page pdf for example
2.convert to binary
Note: now in binary values , the last bit is removed → compare with prev pic
The table is given in the book → table is called cpc -1 , the table is different for text and key
Introduction to AES (ADVANCED ENCRYPTION STANDARD)