Chapter 2_Symmeteric Encryption
Chapter 2_Symmeteric Encryption
Symmetric Encryption
The keystream must be different for each encryption iteration even though the key and nonce can be reused to
maintain security. In order to build the keystream, stream encryption ciphers generate a unique nonce (a number used
only once utilizing feedback shift registers.
Since a mistake in the translation of one bit often does not affect the entire plaintext block, stream cipher encryption
algorithms are less likely to cause system-wide errors to spread. Additionally, stream encryption is linear and
continuous, making it easier and quicker to deploy.
Because XOR is used to combine the left half with the output of the round function, the
operation is reversible:
Li 1 f ( Ri 1 , Ki ) f ( Ri 1 , K i ) Li 1
Solution
Binary: 0000000000000010 0000000000000000 0000000000000000 0000000000000001
The input has only two 1s (bit 15 and bit 64); the output must also have only two 1s (the nature of
straight permutation).
Using Table, we can find the output related to these two bits.
Bit 15 in the input becomes bit 63 in the output. Bit 64 in the input becomes bit 25 in the output.
So the output has only two 1s, bit 25 and bit 63.
0000000000000000 0000000010000000 0000000000000000 0000000000000010
The result in hexadecimal is 0x0000 0080 0000 0002
A round in DES
(encryption site)
DES function
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.
The S-boxes do the real mixing (confusion). DES uses 8 S-boxes, each with a 6-bit input
and a 4-bit output. See Figure 6.7.
Solution
If we write the first and the sixth bits together, we get 11 in binary, which is
3 in decimal.. The remaining bits are 0001 in binary, which is 1 in decimal.
We look for the value in row 3, column 1, in (S-box 1). The result is 12 in
decimal, which in binary is 1100. So the input 100011 yields the output 1100..
Example
To check the avalanche effect in DES, let us encrypt two plaintext blocks (with the same key)
that differ only in one bit and observe the differences in the number of bits in each round.
Number of Rounds
DES uses sixteen rounds of Feistel ciphers. the ciphertext is thoroughly a random
function of plaintext and ciphertext.
1. Weaknesses in S-boxes
2. Weaknesses in P-boxes
3. Weaknesses in Key
Encryption: C = E(K2, (E(K1, P))), P: Plaintext, C: Ciphertext, K1: First key, K2: Second key
Decryption: P = D(K1, (D(K2, C))), P: Plaintext, C: Ciphertext, K2: First key, K1: Second key
The attacker encrypts the plaintext P with all possible values of K1, storing the
intermediate results in a table (T1):
T1 = {E(K1, P) for all K1}
Similarly, the attacker decrypts the known ciphertext C with all possible values of
K2, storing the results in another table (T2):
T2 = {D(K2, C) for all K2}
Normally, to brute-force a 56-bit DES key, one would have to try 256 possible
keys. However, because of the key complement property, for every key K, there
is a corresponding complement key K‾1 that produces a predictable relationship
between ciphertexts. As a result, we only need to test 255 keys instead of 256.
Core Idea:
• Differential cryptanalysis studies how differences in plaintext pairs influence differences in the
corresponding ciphertext pairs after being processed through multiple rounds of the cipher.
• The goal is to analyze these differences to deduce information about the secret key.
Core Idea:
• Linear cryptanalysis attempts to approximate the behavior of a cipher using linear
equations. It analyzes the probability that certain linear combinations of plaintext bits,
ciphertext bits, and key bits hold true.
• By gathering statistical data over many plaintext-ciphertext pairs, the attacker can
deduce bits of the secret key.
00000001
1011 0111
= 10110111
00000001
= 10110110 = B6