Lecture 5 - DeS and Its Variants
Lecture 5 - DeS and Its Variants
4
DES is a block cipher, as shown in Figure
6.5
Encryption
64-bit plain-text (X)
• Plain text:64-bit
• Initial Permutation: IP( )
• Divide in 32-bit LPT+RPT
• Roundi: 1≤ i ≤ 16 key
• Final Permutation Inverse IP: IP-1( )
• Cipher text:64-bit
Initial Permutation IP
F
• Expansion/permutation: E( )
• Substitution/choice: S-box( )
• Permutation: P-Box( )
• X-OR & Swap
The F function of DES
• The L and R each have 32 bits, and the round key K 48 bits.
F ( R, K ) = P ( S ( E ( R ) K ) )
11
Step 1: Key Generation
Expansion
Expansion
Expansion permutation
Since RI−1 is a 32-bit input and KI is a 48-bit key, we first
need to expand RI−1 to 48 bits.
(XOR)
After the expansion permutation, DES uses the XOR
operation on the expanded right section and the round key.
Note that both the right section and the key are 48-bits in
length. Also note that the round key is used only in this
operation.
(Key Generation)
[1]
Step 3: S-Box Substitution
The S-Boxes
0 14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7
1 0 15 7 4 14 2 13 1 10 6 12 11 6 5 3 8
2 4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0
3 15 •12 8 2 4 9 1 7 5 11 3 14 10 0 6 13
◼ P
16 7 20 21 29 12 28 17
1 15 23 26 5 18 31 10
2 8 24 14 32 27 3 9
9 13 30 6 22 11 4 25
Step 5:XOR & SWAP
Li-1 Ri-1
Expansion/permutation (E_table)
XOR Ki
F Substitution/choice (S-box)
Permutation (P)
XOR
Li Ri Next Round
Final Permutation
• At the end of the 16 rounds, it is performed only
once.
-1
• Simple transposition ◼ IP
Bit 0 1 2 3 4 5 6 7
1 40 8 48 16 56 24 64 32
9 39 7 47 15 55 23 63 31
17 38 6 46 14 54 22 62 30
25 37 5 45 13 53 21 61 29
33 36 4 44 12 52 20 60 28
41 35 3 43 11 51 19 59 27
49 34 2 42 10 50 18 58 26
57 33 1 41 9 49 17 57 25
Decryption
• The same algorithm as
encryption.
• Reversed the order of key
(Key16, Key15, … Key1).
• For example:
• IP undoes IP-1 step of
encryption.
• 1st round with SK16 undoes
16th encrypt round.
[1]
Multiple Encryption with DES
• In 2001, NIST published the Advanced Encryption Standard
(AES) to replace DES.
• Decryption: P = DK1(DK2(C))
• Wrong!
27
Triple-DES with Two-Keys
• If algorithm uses 3 encryptions
• would seem to need 3 distinct keys
• but can we use 2 keys with E-D-E sequence
• C = EK1[DK2[EK1[P]]]
• P = DK1[EK2[DK1[C]]]
• So Triple DES work with two keys
• This is called as EDE mode.
• standardized in ANSI X9.17 & ISO8732
• no current known practical attacks
Triple-DES with Three-Keys
• although are no practical attacks on two-key Triple-
DES have some indications
• can use Triple-DES with Three-Keys to avoid even
these
• C = EK3[EK2[EK1[P]]]
• has been adopted by some Internet applications,
• E.g PGP, S/MIME
• Highly Secure
THANK YOU