Hacking - The Art of Exploitation, 2nd Edition

(Romina) #1
Cryptology 399

and diffusion. Confusion refers to methods used to hide relationships between


the plaintext, the ciphertext, and the key. This means that the output bits


must involve some complex transformation of the key and plaintext. Diffusion


serves to spread the influence of the plaintext bits and the key bits over as


much of the ciphertext as possible. Product ciphers combine both of these


concepts by using various simple operations repeatedly. Both DES and AES


are product ciphers.


DES also uses a Feistel network. It is used in many block ciphers to


ensure that the algorithm is invertible. Basically, each block is divided into


two halves, left (L) and right (R). Then, in one round of operation, the new


left half (Li) is set to be equal to the old right half (Ri− 1 ), and the new right


half (Ri) is made up of the old left half (Li− 1 ) XORed with the output of a


function using the old right half (Ri− 1 ) and the subkey for that round (Ki).


Usually, each round of operation has a separate subkey, which is calculated


earlier.


The values for Li and Ri are as follows (the ⊕ symbol denotes the XOR


operation):


Li =Ri− 1


Ri=Li− 1 ⊕f(Ri− 1 ,Ki)


DES uses 16 rounds of operation. This number was specifically chosen to


defend against differential cryptanalysis. DES’s only real known weakness is


its key size. Since the key is only 56 bits, the entire keyspace can be checked


in an exhaustive brute-force attack in a few weeks on specialized hardware.


Triple-DES fixes this problem by using two DES keys concatenated


together for a total key size of 112 bits. Encryption is done by encrypting the


plaintext block with the first key, then decrypting with the second key, and


then encrypting again with the first key. Decryption is done analogously, but


with the encryption and decryption operations switched. The added key size


makes a brute-force effort exponentially more difficult.


Most industry-standard block ciphers are resistant to all known forms of


cryptanalysis, and the key sizes are usually too big to attempt an exhaustive


brute-force attack. However, quantum computation provides some interesting


possibilities, which are generally overhyped.


0x731 Lov Grover’s Quantum Search Algorithm........................................


Quantum computation gives the promise of massive parallelism. A quantum


computer can store many different states in a superposition (which can be


thought of as an array) and perform calculations on all of them at once.


This is ideal for brute forcing anything, including block ciphers. The super-


position can be loaded up with every possible key, and then the encryption


operation can be performed on all the keys at the same time. The tricky part


is getting the right value out of the superposition. Quantum computers are


weird in that when the superposition is looked at, the whole thing decoheres


into a single state. Unfortunately, this decoherence is initially random, and


the odds of decohering into each state in the superposition are equal.

Free download pdf