Data Encryption Standard
Data Encryption Standard
DES History
The most widely used encryption scheme is based on the Data Encryption Standard (DES) adopted in 1977 by the National Bureau of Standards. The algorithm itself is referred to as the Data Encryption Algorithm (DEA).For DES, data are encrypted in 64-bit blocks using a 56-bit key. The algorithm transforms 64-bit input in a series of steps into a 64-bit output. The same steps, with the same key, are used to reverse the encryption. The DES may be double or triple encrypted for additional security with the user employing different key after each transmission. The key size of DES is 56, so 256 combination of keys are possible, thats why it provide high security. Cryptography expert in industry and govt. agencies mention that DES is still a reliable standard. Operation in one try per microsecond it would require approx. 2284 years to break the code. Three basic parts are there: Initial and final permutation, DES function, Key arrangement algorithm.
DES Structure
1 2 8 ..2540..58.64
38 6 37 5
36 4 35 3 34 2
46 14 54 22 62 30 45 13 53 21 61 29
44 12 52 20 60 28 43 11 51 19 59 27 42 10 50 18 58 26
57 49 41 33 25 17 9
59 51 43 35 27 19 11 3 61 53 45 37 29 21 13 5 63 55 47 39 31 23 15 7
33 1
41 9
49 17 57 25
Round block
DES Function
32 bits plaintext Sub key 48 bit Expansion P-box 48 bit 48 bit 48 bit
32 bit
Straight P-box
32 bit
Expansion P-box: the 32-bit half-block is expanded to 48 bits using the expansion permutation, it divided into 8 4bit section. The output consists of eight 6-bit(8*6=48bits) pieces, each containing a copy of 4 corresponding input bits, plus a copy of the immediately adjacent bit from each of the input pieces to either side. That means input bit 1,2,3and 4are copied to output bits 2,3,4and 5 respectively. Output bit 1 comes from the 4 bit of previous section, and the 6th bit comes form the 1st bit of the next section the same rules apply to bit 1 to 32.
32
4
1
5
2
6
3
7
4
8
5
9
8
12 16 20 24 28
9
13 17 21 25 29
10
14 18 22 26 30
11
15 19 23 27 31
12
16 20 24 28 32
13
17 21 25 29 1
Whitener (X-OR operation): After the Expansion permutation, DES uses the XOR operation on the expanded right section and the round key. Note that both right section and the key are 48 bits in length. S-Box : After mixing in the subkey, the block is divided into eight 6-bit pieces before processing by the S-boxes, or substitution boxes. Each of the eight S-boxes replaces its six input bits with four output bits according to a non-linear transformation, provided in the form of a lookup table. The S-boxes provide the core of the security of DES without them, the cipher would be linear, and trivially breakable. Permutation finally, the 32 outputs from the S-boxes are rearranged according to a fixed permutation, the P-box. This is designed so that, after expansion, each S-box's output bits are spread across 6 different S boxes in the next round. 16 29 1 5 7 12 15 18 20 28 23 31 21 17 26 10
2
32 19 22
8
27 13 11
24
3 30 4
14
9 6 25
Key Generation
Round 1,2,9,16 Others Shift One bit Two bit
Triple DES
In cryptography, Triple DES is the common name for the Triple Data Encryption Algorithm (TDEA or Triple DEA) block cipher, which applies the Data Encryption Standard (DES) cipher algorithm three times to each data block. Because of the availability of increasing computational power, the key size of the original DES cipher was becoming subject to brute force attacks; Triple DES was designed to provide a relatively simple method of increasing the key size of DES to protect against such attacks, without designing a completely new block cipher algorithm. Triple DES uses a "key bundle" which comprises three DES keys, K1, K2 and K3, each of 56 bits .The encryption algorithm is: ciphertext = EK3(DK2(EK1(plaintext))) I.e., DES encrypt with K1, DES decrypt with K2, then DES encrypt with K3. Decryption is the reverse: plaintext = DK1(EK2(DK3(ciphertext))) I.e., decrypt with K3, encrypt with K2, then decrypt with K1. Use of TDES: The electronic payment industry uses Triple DES and continues to develop and promulgate standards based upon it. Microsoft OneNote and Microsoft Outlook 2007 use Triple DES to password protect user content
Triple DES utilizes three 64-bit keys. The data is sent through the three phases of DES with the first key to produce C1. C1 is then sent through the three phases of DES with the second key to produce C2. This second ciphertext is then sent through DES a final time with the third key as described here and depicted in Figure below: E(p,k1)=C1 D(C1,k2)=C2 E(C2,k3)=C3 where E is the DES encryption algorithm, ki is the ith key, p is the original plaintext and C3 is the final ciphertext.
4. The algorithm consist of 8 rounds followed by a final transformation function. 5. Each rounds takes four 16bits sub-blocks as input and produce four 16 bits output blocks. 6. The final transformation also produces four 16 bits blocks which are connected to form the 64 bit cipher text. 7. Each of the round also makes use of six 16 bit sub keys and final transformation uses four sub keys for a total of 52 sub keys.
Plaintext 64 bits
Plaintext block 1
Plaintext block 2
Plaintext block 3
Plaintext block 4
Ciphertext block 1
Ciphertext block 2
Ciphertext block 3
Ciphertext block 4
Ciphertext 64 bits
Round of IDEA
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. Multiply X1 and key K1,1 Add X2 and K1,2 Add X3 and K1,3 Multiply X4 and K1,4 XOR the result of step 1 And 3 XOR the result of step 2 and 4 Multiply the result of step 5 and K1,5 Add the result of step 6 and 7 Multiply the result of step 8 and K1,6 Add the result of step 7 and step 9 XOR the result of step 1 and step 9 XOR the result of step 3 and step 9 XOR the result of step 2 and step 10 XOR the result of step 4 and step 10
Round
Output Transformation
The output of the 8th round become input to the output transformation stage. In the output transformation we use K49, K50, K51 and K52 keys. Let the output of 8th stage are X8,1 , X8,2, X8,3, X8,4 . The following stapes occur: 1. Multiply X8,1 and K49 2. Add X8,2 and K50 3. Add X8,3 and K51 4. Multiply X8,4 and K52
X8,1
X8,2
X8,3
X8,4
K 49
K 51 K 50 Multiply Add Add Multiply
K 52
Ciphertext block 1
Ciphertext block 2
Ciphertext block 3
Ciphertext block 4
Ciphertext 64 bits
Strength of IDEA
The international data encryption algorithm (IDEA) uses a 128 bit key. In order to break the IDEA, one require to perform 2128 . It believe that ,to obtain the correct keys needs to be examined and tried out, a single computer performing one IDEA encryption per microsecond would required more then 54* 1023 years to break IDEA. The following factor consider the strength of IDEA: Block length Key length Diffusion confusion
Prior to encrypting a plaintext block, XOR it with the previous ciphertext block
Ci = EK(Ci-1 Pi), Pi = DK(Ci) Ci-1 For first block, need initialization vector, IV IV must be known to sender and receiver only
Each ciphertext block is dependent on all message blocks before it (so, can be used MAC) Most common mode of use when data available in advance (email, ftp, web, ) Error propagation (itself and next block)
XOR (MSB) s bits of output with s-bit plaintext Ci = Pi Ss[EK(Ci-1)], C0 = IV XOR (MSB) s bits of output with s-bit ciphertext Pi = Ci Ss[EK(Ci-1)], C0 = IV
Key Distribution
For conventional encryption to work, the two parties to an exchange must share the same key, and that key must be protected from access by others. Frequent key changes are required. Therefore, the strength of cryptographic system relays on the key distribution technique.
Key Distribution
There are a number of ways to deliver the key: 1- Physical delivery between two parties A,B. 2- Third party physically delivered the key. 3- A and B use used key to encrypt the new key and transmit it to the other party. 4- Using an encrypted connection to third party, then the third party delivers a key on encrypted links to A and B.