Читать книгу Security Engineering - Ross Anderson - Страница 160
5.4.1 SP-networks
ОглавлениеClaude Shannon suggested in the 1940s that strong ciphers could be built by combining substitution with transposition repeatedly. For example, one might add some key material to a block of input text, and then shuffle subsets of the input, and continue in this way a number of times. He described the properties of a cipher as being confusion and diffusion – adding unknown key values will confuse an attacker about the value of a plaintext symbol, while diffusion means spreading the plaintext information through the ciphertext. Block ciphers need diffusion as well as confusion.
The earliest block ciphers were simple networks which combined substitution and permutation circuits, and so were called SP-networks [1011]. Figure 5.10 shows an SP-network with sixteen inputs, which we can imagine as the bits of a sixteen-bit number, and two layers of four-bit invertible substitution boxes (or S-boxes), each of which can be visualised as a lookup table containing some permutation of the numbers 0 to 15.
The point of this arrangement is that if we were to implement an arbitrary 16 bit to 16 bit function in digital logic, we would need bits of memory – one lookup table of bits for each single output bit. That's hundreds of thousands of gates, while a four bit to four bit function takes only 4 x or 64 bits of memory. One might hope that with suitable choices of parameters, the function produced by iterating this simple structure would be indistinguishable from a random 16 bit to 16 bit function to an opponent who didn't know the value of the key. The key might consist of some choice of a number of four-bit S-boxes, or it might be added at each round to provide confusion and the resulting text fed through the S-boxes to provide diffusion.
Figure 5.10: A simple 16-bit SP-network block cipher
Three things need to be done to make such a design secure:
1 the cipher needs to be “wide” enough
2 it needs to have enough rounds, and
3 the S-boxes need to be suitably chosen.