Unit-1 Block Cipher DES
Unit-1 Block Cipher DES
by William Stallings
Block Cipher Principles
The Data Encryption Standard
Simplified-DES
DES Details
DES Design Issues and Attacks
3DES, AES and Other Block Ciphers
now look at modern block ciphers
one of the most widely used types of
cryptographic algorithms
provide secrecy /authentication services
focus on DES (Data Encryption Standard)
to illustrate block cipher design principles
Input (plaintext) block: 8-bits
Output (ciphertext) block: 8-bits
Key: 10-bits
Rounds: 2
Round keys generated using permutations and left shifts
Encryption: initial permutation, round function, switch
halves
Decryption: Same as encryption, except round keys used
in opposite order
IP = { 2, 6, 3, 1, 4, 8, 5 , 7 }
IP -1 = { 4,1 ,3 ,5 ,7 ,2 ,8 , 6}
P10 = { 3, 5, 2, 7, 4, 10, 1, 9, 8, 6}
P8 = { 6, 3, 7, 4, 8, 5, 10, 9}
IP = { 2.,6, 3 , 1 , 4 , 8 , 5 , 7 }
EP = { 4, 1, 2, 3, 2, 3, 4, 1}
P4 = { 2, 4, 3, 1}
IP -1 = { 4.,1 ,3 , 5 , 7 , 2, 8 , 6}
S-DES (and DES) perform substitutions using S-Boxes
S-Box considered as a matrix: input used to select
row/column; selected element is output
4-bit input: bit1; bit2; bit3; bit4
◦ bit1 , bit4 species row (0, 1, 2 or 3 in decimal)
◦ bit2bit3 species column
◦ 2-bit output
S-DES expressed as functions:
Security of S-DES:
◦ 10-bit key, 1024 keys: brute force easy
◦ If know plaintext and corresponding ciphertext, can
we determine key? Very hard
Encrypt data one block at a time
„Used in broader range of applications
„Typical block size 64 – 128 bits 128 bits
„Most algorithms based on a structure
referred to as Feistel block cipher
n-bit block cipher takes n bit plaintext and produces n bit
ciphertext
2n possible different plaintext blocks
Encryption must be reversible (decryption possible)
Each plaintext block must produce unique ciphertext block
Total transformations is 2n!
key is mapping ; Key length 16 × 4 bits = 64 bits . i.e. concatenate all bits of ciph
n-bit input maps to 2n possible input states
Substitution used to produce 2n output states
Output states map to n-bit output
Ideal block cipher allows maximum number of possible encryption
mappings from plaintext block
Problems with ideal block cipher:
◦ Small block size: equivalent to classical substitution cipher;
cryptanalysis based on statistical characteristics feasible
◦ Large block size: key must be very large;
performance/implementation problems
Key length :
◦ In general, key length is 2n × n
◦ „Actual block size is at least 64 bit ( „Key length will be 2 64× 64 ≈ 1021 „bits)
Diffusion
◦ Statistical nature of plaintext is reduced in ciphertext
◦ E.g. A plaintext letter affects the value of many ciphertext
letters
◦ How: repeatedly apply permutation (transposition) to data,
and then apply function
Confusion
◦ Make relationship between ciphertext and key as complex
as possible
◦ Even if attacker can find some statistical characteristics of
ciphertext, still hard to find key
◦ How: apply complex (non-linear) substitution algorithm
Feistel proposed applying two or more simple ciphers in sequence so
final result cryptographically stronger than component ciphers
n-bit block length; k-bit key length; 2k transformations (rather than 2n !)
Feistel cipher alternates: substitutions, transpositions (permutations)
Applies concepts of diffusion and confusion
Applied in many ciphers today
Approach:
◦ Plaintext split into halves
◦ Subkeys (or round keys) generated from key
◦ Round function, F, applied to right half
◦ Apply substitution on left half using XOR
◦ Apply permutation: interchange to halves
implements Shannon’s S-P net concept
Exact implementation depends on various design features
Block size, e.g. 64, 128 bits: larger values leads to more
diffusion
Key size, e.g. 128 bits: larger values leads to more confusion,
resistance against brute force
Number of rounds, e.g. 16 rounds
Subkey generation algorithm: should be complex
Round function F: should be complex
Other factors include fast encryption in software and ease
of analysis
Tradeoff : security vs performance
Symmetric block cipher
◦ 56-bit key, 64-bit input block, 64-bit output block