Crypto Unit II
Crypto Unit II
Unit-II
Symmetric Ciphers
Decryption
- The process of decryption is similar to encryption with reversed keys.
Start with ciphertext 𝐶 = (𝐿𝑛 , 𝑅𝑛 )
For each round 𝑖 = 𝑛, 𝑛 − 1, … … … . ,1 compute:
𝑅𝑖−1 = 𝐿𝑖
𝐿𝑖−1 = 𝑅𝑖 ⊕ 𝐹(𝑅𝑖−1 , 𝐾𝑖 )
Where, 𝐹 is round function and 𝐾𝑖 is subkey.
Plaintext: 𝑃 = (𝐿0 , 𝑅0 )
Key Generation
In DES encryption, the round-key generator creates sixteen 48-bit keys out of a 56-bit cipher
key.
Initially, 56 bits of the key are selected from the initial 64-bit by Permuted Choice 1 (PC-1),
the remaining eight bits are either discarded or used as parity check bits. The 56 bits are then
divided into two 28-bit halves (𝐶0 &𝐷0 ); each half is thereafter treated separately. In successive
rounds, both halves(𝐶𝑖−1 &𝐷𝑖−1 ) are rotated left by one or two bits specified for each round,
and then 48 subkey bits are selected by Permuted Choice 2, PC-2 (24 bits from the left half,
and 24 from the right) that serves as input to the function 𝐹(𝑅𝑖−1 , 𝐾𝑖 ).
Shifting
Rounds Shift
1, 2, 9, 16 One bit
Others Two bit
The left hand output of an iteration (𝐿𝑖 ) is equal to the right hand input to that iteration 𝑅𝑖−1 .
The right hand output 𝑅𝑖 is exclusive OR of 𝐿𝑖−1 and a complex function 𝐹 of 𝐾𝑖 and 𝑅𝑖−1 . The
function 𝐹 can be depicted by the following figure. 𝑆1, 𝑆2, … … … , 𝑆8 represent the ”S-boxes”
, which maps each combination of 48 input bits into a particular 32 bit pattern.
Decryption of DES
The process is the same as encryption, only the difference is that keys are used in reverse order.
Thus, when in decryption mode, the key schedule algorithm has to generate the round keys as
the sequence 𝐾16 , 𝐾15 , … … … , 𝐾1 .
Double DES
- It does twice what DES normally does only once.
- It uses two keys 𝐾1 & 𝐾2 and encrypt the text using the two keys.
𝐶 = 𝐸𝐾2 (𝐸𝐾1 (𝑃))
- To decrypt simply use DES decryption twice.
𝐶 = 𝐷𝐾1 (𝐷𝐾2 (𝐶))
Triple DES
With Two Keys: It uses three stages of DES for encryption and decryption. The 1st & 3rd
stages use 𝐾1 key and 2nd stage uses 𝐾2 key. To make triple DES compatible with single DES,
the middle stage uses decryption in the encryption side and encryption in the decryption side.
Encryption: 𝐶 = 𝐸𝐾1 (𝐷𝐾2 (𝐸𝐾1 (𝑃)))
Decryption: 𝑃 = 𝐷𝐾1 (𝐸𝐾2 (𝐷𝐾1 (𝐶)))
With Three Keys: It uses three stages of DES for encryption and decryption with three
different keys.
Encryption: 𝐶 = 𝐸𝐾3 (𝐷𝐾2 (𝐸𝐾1 (𝑃)))
Decryption: 𝑃 = 𝐷𝐾1 (𝐸𝐾2 (𝐷𝐾3 (𝐶)))
Semi-weak Key
A semi-weak key creates only two different round keys each of them repeated eight times.
There are six semi-weak key pairs. Specific pairs of keys have identical decryption. That is,
there are two different keys, k1 and k2, for which c = DES(p, k1) and c = DES(p, k2). This
similarity implies that k1 can decrypt a message encrypted under k2.
Finite Fields
Groups
- denoted by {𝐺, ∙}, where ∙ is generic symbol and can be a binary symbol.
- is a set of elements with a binary operation, such that following axioms are obeyed:
𝐴1 : 𝑐𝑙𝑜𝑠𝑢𝑟𝑒 → 𝑖𝑓 𝑎, 𝑏 ∈ 𝐺, 𝑡ℎ𝑒𝑛 𝑎 ∙ 𝑏 ∈ 𝐺
𝐴2 : 𝐴𝑠𝑠𝑜𝑐𝑖𝑎𝑡𝑖𝑣𝑒 → 𝑎 ∙ (𝑏 ∙ 𝑐) = (𝑎 ∙ 𝑏) ∙ 𝑐 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑎, 𝑏, 𝑐 ∈ 𝐺
𝐴3 : 𝐼𝑑𝑒𝑛𝑡𝑖𝑡𝑦 → 𝑎 ∙ 𝑒 = 𝑒 ∙ 𝑎 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑎 ∈ 𝐺
𝐴4 : 𝐼𝑛𝑣𝑒𝑟𝑠𝑒 → 𝑎 ∙ 𝑎′ = 𝑎′ ∙ 𝑎 = 𝑒 𝑓𝑜𝑟 𝑒𝑎𝑐ℎ 𝑎 ∈ 𝐺
𝐴5 : 𝐶𝑜𝑚𝑚𝑢𝑡𝑎𝑡𝑖𝑣𝑒 → 𝑎 ∙ 𝑏 = 𝑏 ∙ 𝑎 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑎, 𝑏 ∈ 𝐺
→ If 𝐴1 , 𝐴2 , 𝐴3 , 𝐴4 satisfies = Group
→ If 𝐴1 , 𝐴2 , 𝐴3 , 𝐴4 , 𝐴5 satisfies = Abelian Group
Rings
- denoted by {𝑅, +,∗}
- is a set of elements with two binary operations addition and multiplication, such that
following axioms are obeyed:
𝐴𝑏𝑒𝑙𝑖𝑎𝑛 𝑔𝑟𝑜𝑢𝑝 𝑢𝑛𝑑𝑒𝑟 𝑎𝑑𝑑𝑖𝑡𝑖𝑜𝑛 [𝐴1 − 𝐴5 ]
𝑀1 : 𝐶𝑙𝑜𝑠𝑢𝑟𝑒 𝑢𝑛𝑑𝑒𝑟 𝑚𝑢𝑙𝑡𝑖𝑝𝑙𝑖𝑐𝑎𝑡𝑖𝑜𝑛 → 𝑖𝑓 𝑎, 𝑏 ∈ 𝑅, 𝑡ℎ𝑒𝑛 𝑎𝑏 ∈ 𝑅
𝑀2 : 𝐴𝑠𝑠𝑜𝑐𝑖𝑎𝑡𝑖𝑣𝑖𝑡𝑦 𝑜𝑓 𝑚𝑢𝑙𝑡𝑖𝑝𝑙𝑖𝑐𝑎𝑡𝑖𝑜𝑛 → 𝑎(𝑏𝑐) = (𝑎𝑏)𝑐 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑎, 𝑏, 𝑐 ∈ 𝑅
𝑀3 : 𝐷𝑖𝑠𝑡𝑟𝑖𝑏𝑢𝑡𝑖𝑣𝑒 → 𝑎(𝑏 + 𝑐) = 𝑎𝑏 + 𝑎𝑐 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑎, 𝑏, 𝑐 ∈ 𝑅
𝑀4 : 𝐶𝑜𝑚𝑚𝑢𝑡𝑎𝑡𝑖𝑣𝑒 → 𝑎𝑏 = 𝑏𝑎 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑎, 𝑏 ∈ 𝑅
𝑀5 : 𝑀𝑢𝑙𝑡𝑖𝑝𝑙𝑖𝑐𝑎𝑡𝑖𝑣𝑒 𝑖𝑑𝑒𝑛𝑡𝑖𝑡𝑦 → 𝑎𝑒 = 𝑒𝑎 = 𝑎 𝑓𝑜𝑟 𝑎𝑙𝑙 𝑎 ∈ 𝑅
𝑀6 : 𝑁𝑜 𝑧𝑒𝑟𝑜 𝑑𝑖𝑣𝑖𝑠𝑜𝑟 → 𝑖𝑓 𝑎𝑏 = 0 𝑡ℎ𝑒𝑛 𝑒𝑖𝑡ℎ𝑒𝑟 𝑎 = 0 𝑜𝑟 𝑏 = 0, 𝑎, 𝑏 ∈ 𝑅
→ If 𝐴1 − 𝑀4 satisfies = Commutative ring
→ If 𝐴1 − 𝑀6 satisfies = Integral domain
Fields
- denoted by {𝐹, +,∗}
- is a set of elements with two binary operations addition and multiplication, such that
following axioms are obeyed:
[𝐴1 − 𝑀6 ]
𝑀7 : 𝑀𝑢𝑙𝑡𝑖𝑝𝑙𝑖𝑐𝑎𝑡𝑖𝑣𝑒 𝑖𝑛𝑣𝑒𝑟𝑠𝑒 → 𝑎𝑎−1 = 𝑎−1 𝑎 = 1
Modular Arithmetic
- According to division rule,
𝑝) 𝑛 (𝑞
−𝑝𝑞 𝑛 = 𝑞𝑝 + 𝑟
𝑟
Where, 𝑝 is dividor, 𝑞 is quotient and r is remainder.
- Mod is an operator that gives the remainder.
E.g.
5 𝑚𝑜𝑑 2 = 1, 7 𝑚𝑜𝑑 9 = 7 , −7 𝑚𝑜𝑑 9 = 2,
15 𝑚𝑜𝑑 3 = 0 , −6 𝑚𝑜𝑑 7 = 1 , 81 𝑚𝑜𝑑 7 = 4,
−13 𝑚𝑜𝑑 10 = 7
Congruent Modulo
Two integers 𝑎 and 𝑏 are said to be congruent modulo 𝑛, if 𝒂 ≡ 𝒃(𝒎𝒐𝒅 𝒏) i.e. when 𝑎 is
divided by 𝑛, we get remainder 𝑏.
E.g. 7 ≡ 2(𝑚𝑜𝑑 5)
𝑎 ≡ 𝑏(𝑚𝑜𝑑 𝑛) ⇔ (𝑎 − 𝑏) 𝑚𝑜𝑑 𝑛 = 0 ⇔ (𝑎 𝑚𝑜𝑑 𝑛) = (𝑏 𝑚𝑜𝑑 𝑛)
Q. 𝑮𝑪𝑫(𝟏𝟔𝟏, 𝟐𝟖) =?
Soln:
Here,
𝑎 = 161 , 𝑏 = 28
Now,
𝒓𝟏 𝒓𝟐 𝒒 𝒓
161 28 5 21
28 21 1 7
21 7 3 0
7 0
∴ 𝐺𝐶𝐷(161, 28) = 7
Q. 𝑮𝑪𝑫(𝟔𝟎, 𝟐𝟓) =?
Soln:
Here,
𝑎 = 60 , 𝑏 = 25
Now,
𝒓𝟏 𝒓𝟐 𝒒 𝒓
60 25 2 10
25 10 2 5
10 5 2 0
5 0
∴ 𝐺𝐶𝐷(60, 25) = 5
Set of Residues
- denoted as 𝑍𝑛 .
- is a set of remainders when divided by 𝑛 i.e. 𝑍𝑛 = {0, 1, 2, 3, … … … . , 𝑛 − 1}.
E.g. 𝑍5 = {0, 1, 2, 3, 4}
𝑍2 = {0, 1}
Operations of 𝒁𝒏
- Addition, subtraction, multiplication
1. Add 7 to 14 in 𝒁𝟏𝟓 .
(7 + 14) 𝑚𝑜𝑑 15 = 21 𝑚𝑜𝑑 15 = 6
2. Subtract 11 from 7 in 𝒁𝟏𝟑 .
(7 − 11) 𝑚𝑜𝑑 13 = −4 𝑚𝑜𝑑 13 = 9
3. Multiply 11 by 7 in 𝒁𝟐𝟎 .
(11 ∗ 7) 𝑚𝑜𝑑 20 = 77 𝑚𝑜𝑑 20 = 17
Residue Class
- denoted as [𝑎] 𝑜𝑟 [𝑎]𝑛 .
- is the set of integers, when divided by 𝑛, we get remainder 𝑎.
- i.e. 𝑥 ∈ [𝑎]𝑛 ; 𝑥 ≡ 𝑎(𝑚𝑜𝑑 𝑛)
E.g.
Let 𝑛 = 4
[0] = {… … … , −12, −8, −4, 0, 4, 8, 12, … … … }
[1] = {… … … , −11, −7, −3, 1, 5, 9, 13, … … … }
[2] = {… … … , −10, −6, −2, 2, 6, 10, 14, … … … }
[3] = {… … … , −9, −5, −1, 3, 7, 11, 15, … … … }
Quadratic Residue
- Suppose ‘𝑝’ is an odd prime and ‘𝑎’ is an integer.
- ‘𝑎’ is defined to be quadratic residue if 𝒚𝟐 ≡ 𝒂(𝒎𝒐𝒅 𝒑), where 𝑦 ∈ 𝑍𝑝
E.g.
𝑝=7
𝑍7 = {1, 2, 3, 4, 5, 6}
12 ≡ 1(𝑚𝑜𝑑 7)
22 ≡ 4(𝑚𝑜𝑑 7)
32 ≡ 2(𝑚𝑜𝑑 7)
42 ≡ 2(𝑚𝑜𝑑 7)
52 ≡ 4(𝑚𝑜𝑑 7)
62 ≡ 1(𝑚𝑜𝑑 7)
Additive inverse of 𝒁𝒏
Multiplicative inverse in 𝒁𝒏
Co-prime
- A Galois field can be defined as a set of numbers that we can add, subtract, multiply and
divide together and only ever end up with a result that exists in our set of numbers.
- The number of elements of a Galois field is of the form 𝑝𝑛 , where 𝑝 is a prime and 𝑛 is a
positive integer. Generally, it is denoted by 𝐺𝐹(𝑝𝑛 ).
𝐺𝐹(𝑝𝑛 )
n =1 n >1
𝐺𝐹(𝑝) 𝐺𝐹(𝑝𝑛 )
(Prime Fields) (Extension Fields)
Polynomial Arithmetic
In general, polynomial is an expression of the form
𝑎𝑛 𝑥 𝑛 + 𝑎𝑛−1 𝑥 𝑛−1 + ⋯ … … + 𝑎1 + 𝑎0
for some non-negative integer 𝑛 and where the coefficient 𝑎0 , 𝑎1 ,……., 𝑎𝑛 are drawn from
some designated set 𝑆. 𝑆 is called the coefficient set.
Addition:
𝑓(𝑥) = 𝑎2 𝑥 2 + 𝑎1 𝑥 + 𝑎0
𝑔(𝑥) = 𝑏1 𝑥 + 𝑏0
𝑓(𝑥) + 𝑔(𝑥) = 𝑎2 𝑥 2 + (𝑎1 + 𝑏1 )𝑥 + (𝑎0 + 𝑏0 )
Subtraction:
𝑓(𝑥) = 𝑎2 𝑥 2 + 𝑎1 𝑥 + 𝑎0
𝑔(𝑥) = 𝑏3 𝑥 3 + 𝑏0
𝑓(𝑥) − 𝑔(𝑥) = −𝑏3 𝑥 3 + 𝑎2 𝑥 2 + 𝑎1 𝑥 + (𝑎0 − 𝑏0 )
Multiplication:
𝑓(𝑥) = 𝑎2 𝑥 2 + 𝑎1 𝑥 + 𝑎0
𝑔(𝑥) = 𝑏1 𝑥 + 𝑏0
𝑓(𝑥) ∗ 𝑔(𝑥) = 𝑎2 𝑏1 𝑥 3 + (𝑎2 𝑏0 + 𝑎1 𝑏1 )𝑥 2 + (𝑎1 𝑏0 + 𝑎0 𝑏1 )
Division:
𝑓(𝑥) = 𝑎2 𝑥 2 + 𝑎1 𝑥 + 𝑎0
𝑔(𝑥) = 𝑏1 𝑥 + 𝑏0
𝑓(𝑥)
=? (Obtained by long division)
𝑔(𝑥)
After the eight rounds comes a final “half round”, for the output.
Key Generation
The 64-bit plaintext block is partitioned into four 16-bit sub-blocks, since all the algebraic
operations used in the encryption process operate on 16-bit numbers. For each of the encryption
round, six 16-bit key sub-blocks are generated from the 128-bit key. Since a further four 16-bit
key-sub- blocks are required for the subsequent output transformation, a total of 52 (= 8 x 6 +
4) different 16-bit sub-blocks have to be generated from the 128-bit key.
The 52 16-bit key sub-blocks which are generated from the 128-bit key are produced as
follows:
First, the 128-bit key is partitioned into eight 16-bit sub-blocks which are then directly used
as the first eight key sub-blocks.
The 128-bit key is then cyclically shifted to the left by 25 positions, after which the resulting
128-bit block is again partitioned into eight 16-bit sub-blocks to be directly used as the next
eight key sub-blocks.
The cyclic shift procedure described above is repeated until all of the required 52 16-bit
key sub-blocks have been generated.
Encryption
The process consists of eight identical encryption steps (known as encryption rounds) followed
by an output transformation.
- The first four 16-bit key sub-blocks are combined with two of the 16-bit plaintext blocks
using addition modulo 216 , and with the other two plaintext blocks using multiplication
modulo 216 + 1.
- At the end of the first encryption round four 16-bit values are produced which are used as
input to the second encryption round.
- The process is repeated in each of the subsequent 7 encryption rounds.
- The four 16-bit values produced at the end of the 8th encryption round are combined with
the last four of the 52 key sub-blocks using addition modulo 216 and multiplication modulo
216 + 1 to form the resulting four 16- bit ciphertext blocks.
Decryption
- The computational process used for decryption of the cipher text is essentially the same as
that used for encryption of the plaintext.
- The only difference is that each of the 52 16-bit key sub- blocks used for decryption is the
inverse of the key sub-block used during encryption in respect of the applied algebraic
group operation.
- Additionally, the key sub-blocks must be used in the reverse order during decryption in
order to reverse the encryption process.
𝑋𝑎 𝑋𝑏 𝑋𝑐 𝑋𝑑
𝑋𝑎 = 𝑋𝑎 ⊙ 𝐾𝑎
⊙ 𝐾𝑎 ⊞ 𝐾𝑏 ⊞ 𝐾𝑐 ⊙ 𝐾𝑑
𝑋𝑏 = 𝑋𝑐 ⊞ 𝐾𝑐
𝑋𝑐 = 𝑋𝑏 ⊞ 𝐾𝑏
𝑋𝑑 = 𝑋𝑑 ⊙ 𝐾𝑑
𝑋𝑎 𝑋𝑏 𝑋𝑐 𝑋𝑑
Even Round
- There are four input 16-bit sub-blocks (𝑋𝑎 , 𝑋𝑏 , 𝑋𝑐 , 𝑋𝑑 ) from the previous round.
- Uses 2 16-bit keys (𝐾𝑒 &𝐾𝑓 ).
It works as follows:
𝑌𝑖𝑛 = 𝑋𝑎 ⊕ 𝑋𝑏
𝑍𝑖𝑛 = 𝑋𝑐 ⊕ 𝑋𝑑
𝑌𝑜𝑢𝑡 = ((𝐾𝑒 ⊙ 𝑌𝑖𝑛 ) ⊞ 𝑍𝑖𝑛 ) ⊙ 𝐾𝑓
𝑍𝑜𝑢𝑡 = ((𝐾𝑒 ⊙ 𝑌𝑖𝑛 ) ⊞ 𝑌𝑜𝑢𝑡 )
𝑋𝑎 = 𝑋𝑎 ⊕ 𝑌𝑜𝑢𝑡
𝑋𝑏 = 𝑋𝑏 ⊕ 𝑌𝑜𝑢𝑡
𝑋𝑐 = 𝑋𝑐 ⊕ 𝑍𝑜𝑢𝑡
𝑋𝑑 = 𝑋𝑑 ⊕ 𝑍𝑜𝑢𝑡
AES treats the 128-bits block (16 bytes) as a 4 × 4 byte array, called state matrix.
𝑎00 𝑎01 𝑎02 𝑎03
𝑎10 𝑎11 𝑎12 𝑎12
𝑎20 𝑎21 𝑎22 𝑎23
𝑎30 𝑎31 𝑎32 𝑎33
All the four AES operations are applied on the matrices further. These operations can be
described as:
1. Sub Bytes
In the SubBytes step, each byte in the state is replaced with the corresponding S-box value,
𝑆; 𝑏𝑖𝑗 = 𝑆(𝑎𝑖𝑗 ).
The S-box is a special lookup table which is constructed by Galois fields. The generation
algorithm used in this algorithm is 𝐺𝐹(28 ) i.e 256 values are possible. The elements of S-
box are written in hexadecimal system.
AES S-box lookup table appears as shown below:
For E.g. 𝑆(3𝐶) = 𝐸𝐵since 𝐸𝐵 appears in row 3 and column 𝐶 of above given tabe.
For decryption, the inverse of SubBytes (InvSubBytes) is the same operation using the inversed
S-box, which is also pre-calculated.
2. Shift Rows
In the ShiftRows step, bytes in each row of the state are shifted cyclically to the left. The
number of places each byte is shifted differs for each row.
1st row: no shift.
2nd row: a 1-byte circular left shift.
3rd row: a 2-byte circular left shift.
4th row: a 3-byte circular left shift.
The inverse of Shift Row is the same cyclically shift but to the right.
3. Mix Columns
Each column of four bytes is now transformed using a special mathematical function. This
function takes as input the four bytes of one column and outputs four completely new bytes,
which replace the original column. The result is another new matrix consisting of 16 new
bytes. It should be noted that this step is not performed in the last round.
Each column of the state is multiplied with a fixed matrix. The multiplication is field
multiplication in Galois field.
To create round keys for each round, AES uses a key expansion process. If the number of
rounds is 𝑁𝑟 , the key expansion routines creates 𝑁𝑟 + 1 128-bit round keys for one single 128-
bit cipher key.
It takes 128 bits (16-bytes) key and expands into array of 44 32-bit words. For the purpose of
adding the key to state, each word is considered as column matrix.
Round Words
Pre-round 𝑤0 𝑤1 𝑤2 𝑤3
1 𝑤4 𝑤5 𝑤6 𝑤7
2 𝑤8 𝑤9 𝑤10 𝑤11
… …
𝑁𝑟 𝑤4𝑁𝑟 𝑤4𝑁𝑟 +1 𝑤4𝑁𝑟 +2 𝑤4𝑁𝑟 +3
Calculation of 𝒈 function includes following 3 processes:
1. RotWord performs a one byte circular left shift on a word. For e.g.
𝑅𝑜𝑡𝑊𝑜𝑟𝑑[𝑏0 , 𝑏1 , 𝑏2 , 𝑏3 ] → [𝑏1 , 𝑏2 , 𝑏3 , 𝑏4 ]
2. SubWord performs a byte substitution on each byte of input word using S-box.
3. The result of step 1 and 2 is XORed with 𝑅𝐶𝑜𝑛[𝑗]- the round constant.
Round Constant (RCon):
- The round constant is a word in which the three rightmost bytes are always 0.
- It is different for each round and defined as:
𝑅𝐶𝑜𝑛[𝑗] = (𝑅𝐶𝑜𝑛[𝑗], 0, 0, 0)
Where, 𝑅𝐶𝑜𝑛[1] = 1, 𝑅𝐶𝑜𝑛[𝑗] = 2 ∗ 𝑅𝐶𝑜𝑛[𝑗 − 1]
AES DES
AES stands for Advanced Encryption DES stands for Data Encryption Standard.
Standard.
Block Size is 128 bits. Block size is 64 bits.
Key length can be of 128-bits, 192-bits and Key length is 56 bits in DES.
256-bits.
AES divides plaintext into 128-bit block each DES divides plaintext message 64-bit block
and treats each block as a 4 x 4 array. The each and encrypts using 56-bit key.
block is then encrypted using one of the three
different key lengths, 128, 192 & 256 bits.
Number of rounds depends on key length : DES involves 16 rounds of identical
10(128-bits), 12(192-bits) or 14(256-bits) operations
AES structure is based on substitution- DES structure is based on feistal network.
permutation network.
AES is faster. DES is comparatively slower.
AES is more secure than DES. DES is less secure
The rounds in AES are: Byte Substitution, The rounds in DES are: Expansion, XOR
Shift Row, Mix Column and Key Addition. operation with round key, Substitution and
Permutation.
AES was designed by Vincent Rijmen and DES was designed by IBM.
Joan Daemen.
Q. Consider the message blocks 𝒎𝟏, 𝒎𝟐 , 𝒎𝟑 . If the cipher block chaining mode DES
encryption can be expressed as 𝑪𝒊 = 𝑫𝑬𝑺(𝒎𝒊 ⊕ 𝒎𝒊−𝟏 ⊕ 𝑪𝒊−𝟏 ); 𝒎𝟎 ⊕ 𝑪𝟐 = 𝑰𝑽. Now,
write the expression for the DES decryption to extract each of the message blocks
𝒎𝟏, 𝒎𝟐 , 𝒎𝟑 .
Soln:
Encryption
Given,
𝐶𝑖 = 𝐷𝐸𝑆(𝑚𝑖 ⊕ 𝑚𝑖−1 ⊕ 𝐶𝑖−1 )
𝐶1 = 𝐷𝐸𝑆(𝑚1 ⊕ 𝑚0 ⊕ 𝐶0 )
𝐶2 = 𝐷𝐸𝑆(𝑚2 ⊕ 𝑚1 ⊕ 𝐶1 )
𝐶3 = 𝐷𝐸𝑆(𝑚3 ⊕ 𝑚2 ⊕ 𝐶2 )
Decryption
Expression for the decryption:
𝑚𝑖 = 𝐷𝐸𝑆𝑑 (𝐶𝑖 )⨁𝑚𝑖−1 ⊕ 𝐶𝑖−1
𝑚1 = 𝐷𝐸𝑆𝑑 (𝐶1 )⨁𝑚0 ⊕ 𝐶0
𝑚2 = 𝐷𝐸𝑆𝑑 (𝐶2 )⨁𝑚1 ⊕ 𝐶1
𝑚3 = 𝐷𝐸𝑆𝑑 (𝐶3 )⨁𝑚2 ⊕ 𝐶2