100 likes | 122 Views
Simplified DES. Cryptography and Network Security. Reference: Sec 3.1 of Stallings Text. Components of DES. Key generation Bit permutations S-boxes Bit Rotations and exclusive-or operations. Simplified DES. Key: 10 bits Generates two 8-bit keys Plaintext and ciphertext: 8 bits
E N D
Simplified DES Cryptography and Network Security Reference: Sec 3.1 of Stallings Text
Components of DES • Key generation • Bit permutations • S-boxes • Bit Rotations and exclusive-or operations
Simplified DES • Key: 10 bits • Generates two 8-bit keys • Plaintext and ciphertext: 8 bits • Encryption:ctxt = IP-1(fk(SW(fk(IP(ptxt),K1)),K2)) • Decryption:ptxt = IP-1(fk(SW(fk(IP(ptxt),K2)),K1))
Key Generation • Permute 10-bit key (using P10) • Split into two 5-bit parts • K1 • Rotate both parts once, concatenate, then apply permutation P8 • K2 • Rotate both parts 3 times, concatenate, then apply permutation P8
Encryption • Apply permutation IP to plaintext • Apply a function f to update the left half of the result using K1 • Switch left and right halves of the result • Apply a function f to update the left half of the result using K2 • Apply permutation IP-1 on the result to produce ciphertext
Decryption • Apply permutation IP to the ciphertext • Apply a function f to update the left half of the result using K2 • Switch left and right halves of the result • Apply a function f to update the left half of the result using K1 • Apply permutation IP-1 on result to produce the plaintext
f(SK, input) • Only the left four bits (L) of input will be affected; the right four bits (R) will be used but not affected • L = L ^ F(R, SK) • ^ means exclusive or • F(R, SK) is a function that takes a 4-bit string and an 8-bit key
F(R,SK) • Permute/expand R using EP to obtain R’ • Becomes 8 bits • R’ = R’ ^ SK • Suppose R’ = b7b6b5b4b3b2b1b0 • Use bit-pairs as indices for the S-boxes • S0[b7b4][b6b5] S1[b3b0][b2b1] • Permute using P4
Manipulating Bits in a Program • Important Bit-wise operations: • and &, or |, not ~, xor ^, shifts << >> • Useful functions • Retrieve a bit • Set a bit • Rotate/shift left
Exercises • Encrypt by hand • Key = 1011001001 • Plaintext = 10111110 • Use the posted SDES program to observe the effect on the ciphertext • Of a bit change in the key • Of a bit change in the plaintext