cryptography 2
cryptography 2
L1 R1
Round i
Ki
F
Li Ri
Round n
Kn
Ln Rn
F
Ln+1 Rn+1
Ln Rn
▪ On Decryption Side:
Data Encryption Standard (DES)
▪ Type: Block Cipher
▪ Block Size : 64-bit
▪ Key Size: 64-bit, with only 56-bit effective
▪ Number of Rounds: 16
64-bit plaintext 64-bit key
K16 48 56
Round 16 Permuted choice 2 Left circular shift
32-bit swap
64
Inverse
Initial Permutation
DES Encryption
64-bit ciphertext
Algorithm
DES Encryption Algorithm (Cont…)
▪ First, the 64-bit plaintext passes through an initial permutation
(IP) that rearranges the bits to produce the permuted input.
▪ This is followed by a phase consisting of sixteen rounds of the
same function, which involves both permutation and substitution
functions.
▪ Finally, the preoutput is passed through a permutation that is the
inverse of the initial permutation function, to produce the 64-bit
ciphertext.
▪ The 56-bit key is passed through a permutation function.
▪ For each of the sixteen rounds, a subkey (Ki) is produced by the
combination of a left circular shift and a permutation.
DES Single Round
32-bits 32-bits 28-bits 28-bits
Substitution/choice
(S-box)
32
Permutation
(P)
32
XOR
DES Single Round (Cont…)
1. Key Transformation
• Permutation of selection of sub-key from original key
2. Expansion Permutation (E-table)
• Right half is expanded from 32-bits to 48-bits
3. S-box Substitution
• Accepts 48-bits from XOR operation and produce 32-bits using
8 substitution boxes (each S-boxes has a 6-bit i/p and 4-bit
o/p).
4. P-Box Permutation
5. XOR and Swap
Role of S-box
Role of S-box (Cont…)
▪ The outer two bits of each group select one row of an S-box.
▪ Inner four bits selects one column of an S-box.
S-box 1
▪ Example:
Input 0 1 1 0 0 1 Output 1 0 0 1
Row Column
Avalanche Effect
▪ Desirable property of any encryption algorithm is that a change in
one bit of the plaintext or of the key should produce a change in
many bits of cipher text.
▪ DES performs strong avalanche effect.
▪ Although the two plaintext blocks differ only in the rightmost bit,
the ciphertext blocks differ in 29 bits.
▪ This means that changing approximately 1.5 % of the plaintext
creates a change of approximately 45 % in the ciphertext.
AES (Advanced Encryption Standard)
▪ The Rijndael proposal for AES defined a cipher in which the block length
and the key length can be independently specified to be 128, 192, or
256 bits.
Key size (words/ bytes/ bits) 4/16/128 6/24/192 8/32/256
Block size (words/ bytes/ bits) 4/16/128 4/16/128 4/16/128
Round key size (words/ bytes/ bits) 4/16/128 4/16/128 4/16/128
Number of Rounds 10 12 14
▪ AES designed to have characteristics
1. Resistance against all known attacks
2. Speed and code compactness on a wide range of platforms
3. Design simplicity
AES (Advanced Encryption Standard)