DES and AES Algorithm
DES and AES Algorithm
Symmetric‐Key Encryption
By:
Alemwork
Debark University
Symmetric‐Key Encryption : Block ciphers and Stream ciphers
Block ciphers : Widely used block ciphers
• Some of the block cipher algorithms widely used today are:
i. Feistel Cipher
ii. DES
iii. Double DES
iii. Triple DES
iv.AES
v.Three More Block Ciphers:
a. IDEA
b. Blowfish
c. RC6
vi. TEA
vii. Block Cipher Modes
Symmetric-Key/Private Key Encryption
58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4,
62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8,
57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3,
61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7
48-bit output
• This is sometimes called the E-box.
• For each 4-bit input block, the first and fourth bits each represent two bits of the output
block, while the second and third bits in input block each represent one bit of the
output block.
Symmetric-Key/Private Key Encryption
• For example, the bit in position 3 of the input block moves to position 4 of the output
block, and the bit in position 21 of the input block moves to positions 30 and 32 of the
output block.
• Although the output block is larger than the input block, each input block generates a
unique output block.
Symmetric-Key/Private Key Encryption
• The input bits specify an entry in the S-box in a very particular manner.
• Consider an S-box input of 6 bits, labeled b0, b1, b2, b3, b4 and b5.
• Bits b0 and b5 are combined to form a 2-bit number, from 0 to 3, which
corresponds to a row in thetable.
• The middle 4 bits, b1 through b4 are combined to form a 4- bitnumber, from
0 to 15, which corresponds to acolumn in the table.
Symmetric-Key/Private Key Encryption
• For example, bit 21 moves to bit 4, while bit 4 moves to bit 31.
• Finally, the result of the P-box permutation is XORed with the left half of the initial 64-
bit data block.
• Then the left and right halves are switched and another round begins.
Symmetric-Key/Private Key Encryption
• Note: The left and right halves are not exchanged after the last round of DES; instead
the concatenated block R16L16 is used as the input to the final permutation.
• There‟s nothing going on here; exchanging the halves and shifting around the
permutation would yield exactly the same result.
• This is so that the algorithm can be used to both encrypt and decrypt.
Symmetric-Key/Private Key Encryption
Character 0 1 2 3 4 5 6 7 8 9 a b c d e F
• Example:
• If s1,1 = {53}, then the substitution value is the intersection of the row with
index „5‟ and the column with index „3‟ in the following Figure.
• This results in s’1,1 having a value of {ed}.
Symmetric-Key/Private Key Encryption
• The ShiftRows step operates on the rows of the state; it cyclically shifts the bytes
in each row by a certain offset.
• For AES, the first row is left unchanged.
• Each byte of the second row is shifted one to the left.
• Similarly, the third and fourth rows are shifted by offsets of two and three
respectively.
• The inverse shift row transformation, called InvShiftRows, performs the circular
shifts in the opposite direction for each of the last three rows, with a 1-byte
circular right shift for the second row, and so on.
Symmetric-Key/Private Key Encryption
• In this case, the individual additions and multiplications of the matrix multiplication
are performed in GF(28).
Symmetric-Key/Private Key Encryption
• To summarize,
• In the AddRoundKey step, each byte of the state is combined with a byte of the round
subkey using the XOR operation (⊕).
• In the AddRoundKey step, the subkey is combined with the state.
• For each round, a subkey is derived from the main key using Rijndael's key schedule;
each subkey is the same size as the state.
• The subkey is added by combining each byte of the state with the corresponding byte
of the subkey using bitwise XOR.
Symmetric-Key/Private Key Encryption
Then the first 4 bytes (first column) of the round key for round 9 are calculated as
follows:
• In AES, we noted that AES four functions, ByteSub, ShiftRow, MixColumn, and
AddRoundKey, are invertible.
• As a result, the entire algorithm is invertible, and consequently AES can decrypt as
well as encrypt.
Thank y o u