CHAPTER 12: From Crypto-Theory to Crypto-Practice I CRYPTOANALYSIS of linear feedback shift registers Linear Recurrences Linear feedback shift registers are an efficient way to realize recurrence relations of the type x[n+m] = c[0] x[n] + c[1] x[n+1]+ … + c[m-1] x[n+m-1 ] (mod n) that can be specified by 2m bits c[0] , … , c[m-1] and x[1] , … , x[m]. Finding Linear Recurrences To test whether a given portion of a key was generated by a recurrence of length m if we know x[1] , … , x[2m ] we need to solve the matrix equation and then to verify whether remaining available bits x[2m+1] , … are really generated by the recurrence obtained. [ ]Finding Linear Recurrences The basic idea to find linear recurrences generating a given sequence is to check whether there is such a recurrence for m = 2, 3, … In doing that we use the following result. Theorem Let If the sequence x[1] , x[2] , … , x[2m-1 ] satisfies a linear recurrence of length less than m, then det(M) = 0. Conversely, if the sequence x[1] , x[2] , … , x[2m-1 ] satisfies a linear recurrence of length m and detM = 0, then the sequence also satisfies a linear recurrence of length less than m. How to make cryptoanalysts' task harder? Confusion and difussion Two fundamental cryptographic techniques, introduced already by Shannon, are confusion and diffusion. Confusion obscures the relationship between the plaintext and the ciphertext, which makes much more difficult a cryptanalyst’s attempts to study cryptotext by looking for redundancies and statistical patterns. (The best way to cause confusion is through complicated substitutions.) Diffusion dissipates redundancy of the plaintext by spreading it over cryptotext - that again makes much more difficult a cryptanalyst’s attempts to search for redundancy in the plaintext through observation of cryptotext. (The best way to achieve it is through transformations that cause that bits from different positions in plaintext contribute to the same bit of cryptotext.) Mono-alphabetic cryptosystems use no confusion and no diffusion. Polyalphabetic cryptosystems use only confusion. In permutation cryptosystems only diffusion step is used. DES essentially uses a sequence of confusion and diffusion steps. Cryptosystem DES and its history 15. 5. 1973 National Burea of Standards published a solicitation for a new cryptosystem. This led to the development of so far the most often used cryptosystem Data Encryption Standard - DES DES was developed at IBM, as a modification of an earlier cryptosystem called Lucifer. 17. 3. 1975 DES was published for first time. After a heated public discussion, DES was adopted as a standard on 15. 1. 1977. DES used to be reviewed by NBS every 5 years. DES cryptosystem - Data Encryption Standard - 1977 DES cryptosystem - Data Encryption Standard - 1977 How fast is DES? The DES controversy 1. There have been suspicions that the design of DES might contain hidden “trapdoors'‘ what allows NSA to decrypt messages. 2. The main criticism has been that the size of the keyspace, 2 ^56 , is too small for DES to be really secure. 3. In 1977 Diffie+Hellamn sugested that for 20 milions$ one could build a VLSI chip that could search the entire key space within 1 day. 4. In 1993 M. Wiener suggested a machine of the cost 100.000$ that could find the key in 1.5 days. What are key elements of DES? • A cryptosystem is called linear if each bit of cryptotext is a linear combination of bits of plaintext. • For linear cryptosystems there is a powerful decryption method - so-called linear cryptanalysis. • The only components of DES that are non-linear are S-boxes. • Some of original requirements for S-boxes: – Each row of an S-box should include all possible output bit combinations; – It two inputs to an S-box differ in precisely one bit, then the output must differ in a minimum of two bits; – If two inputs to an S-box differ in their first two bits, but have identical last two bits, the two outputs have to be distinct. • There have been many other very technical requirements. Weaknesses of DES • Existence of weak keys: they are such keys k that for any plaintext p, E[k](E[k](p)) = p. There are four such keys: k Î {(0^28, 0^28), (1^28, 1^28), (0^28, 1^28), (1^28, 0^28)} • The existence of semi-weak key pairs (k[1], k[2]) such that for any plaintext E[k1](E[k2](p)) = p. • The existence of complementation property E[c(k)](c(p)) = c(E[k](p)), where c(x) is binary complement of binary string x. DES modes of operation 8-bit VERSION of the CFB MODE In this mode each 8-bit piece of the plaintext is encrypted without having to wait for an entire block to be available. The plaintext is broken into 8-bit pieces: P=[P[1],P[2],…]. Encryption: An initial 64-bit block X[1] is chosen and then, for j=1,2,… , the following computation is done: Advantages of different encryption modes • CBC mode is used for block-encryption and also for authentication; • CFB mode is used for streams-encryption; • OFB mode is used for stream-encryptions that require message authentication; CTR MODE Counter Mode - some consider it as the best one. Key design: k[i] = E[k](n, i) for a nonce n; Encryption: y[i] = x[i] AA k[i ]This mode is very fast because a key stream can be parallelised to any degree. Because of that this mode is used in network security applications. Killers and death of DES • In 1993 M. J. Weiner suggested that one could design, using one million dollars, a computer capable to decrypt, using brute force, DES in 3.5 hours. • In 1998 group of P. Kocher designed, using a quarter million of dolars, a computer to decrypt DES in 56 hours. • In 1999 they did that in 24 hours. • It started to be clear that a new cryptosystem with larger keys is badly needed. Product- and Feistel-cryptosystems Design of several important practical cryptosystems used the following three general design principles. A product cryptosystem combines two or more crypto-transformations in such a way that resulting cryptosystem is more secure than component transformations. An iterated block cryptosystem iteratively uses a round function (and it has as parameters number of rounds r, block bit-size n, subkeys bit-size k) of the input key K from which r subkeys K[i] are derived. A Feistel cryptosystem is an iterated cryptosystem mapping 2t-bit plaintext (L[0],R[0]). of t-bit blocks L[0] and R[0] to a cryptotext (R[r],L[r]), through an r-round process where r >0. For 0