An Evaluation of the Klimov-Shamir Keystream Generator Timothy D
Total Page:16
File Type:pdf, Size:1020Kb
Masthead Logo Iowa State University Capstones, Theses and Retrospective Theses and Dissertations Dissertations 1-1-2005 An evaluation of the Klimov-Shamir keystream generator Timothy D. Dewey Iowa State University Follow this and additional works at: https://lib.dr.iastate.edu/rtd Recommended Citation Dewey, Timothy D., "An evaluation of the Klimov-Shamir keystream generator" (2005). Retrospective Theses and Dissertations. 18877. https://lib.dr.iastate.edu/rtd/18877 This Thesis is brought to you for free and open access by the Iowa State University Capstones, Theses and Dissertations at Iowa State University Digital Repository. It has been accepted for inclusion in Retrospective Theses and Dissertations by an authorized administrator of Iowa State University Digital Repository. For more information, please contact [email protected]. An evaluation of the Klimov-Shamir keystream generator by Timothy D. Dewey A thesis submitted to the graduate faculty in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE Major: Information Assurance Program of Study Committee: Cliff Bergman, Major Professor Jonathan Smith Doug Jacobson Iowa State University Ames, Iowa 2005 Copyright ©Timothy D. Dewey, 2005. All rights reserved. ii Graduate College Iowa State University This is to certify that the master's thesis of Timothy D. Dewey has met the thesis requirements of Iowa State University Signatures have been redacted for privacy iii DEDICATION I would like to dedicate this thesis to Dr. Frank Blume. Without his expertise and dedica tion, I would not have pursued this goal. IV TABLE OF CONTENTS LIST OF TABLES . VI LIST OF FIGURES vii ABSTRACT. Vlll CHAPTER 1. TRADITIONAL STREAM CIPHERS 1 1.1 One-time Pad- Motivation for Stream Ciphers 1 1.2 Definitions and Examples . 3 1.3 Common Constructions- Clock Controlled Generators 8 CHAPTER 2. PROPERTIES OF STREAM CIPHERS . 10 2.1 Definitions and Notation . 10 2 .1.1 Definit ions 10 2.1.2 Notation .. 10 2.2 Basic Properties of Synchronous Stream Ciphers 11 2.3 Pseudorandomness . .... ... .. ..... 13 CHAPTER 3. T-FUNCTION KEYSTREAM GENERATORS . 16 3.1 Definitions and Notations 16 3 .1.1 Definitions 16 3.1.2 Notation .. 16 3.2 Advantages of T -functions 17 3.3 Constructions for Keystreams 19 3.4 Properties of T -function Cycles and Streams 20 3.5 Vulnerabilities of T-functions . ....... 22 v CHAPTER 4. EVALUATION OF KLIMOV-SHAMIR GENERATOR... 31 4.1 Proposed Keystream Generator by Klimov and Shamir . 31 4.2 Evaluation Using Golomb's Randomness Postulates . 32 4.2.1 Evaluation Using Postulate 1 32 4.2.2 Evaluation Using Postulate 2 32 4.2.3 Evaluation Using Postulate 3 34 4.3 Proposed Attacks on the Klimov-Shamir Generator . 37 4.4 A Proposed Construction . 40 CHAPTER 5. CONCLUSIONS AND OPEN PROBLEMS 44 APPENDIX TABLES AND GRAPHS 46 BIBLIOGRAPHY . ... 54 ACKNOWLEDGEMENTS 56 Vl LIST OF TABLES 3.1 Example of Theorem 3.4.2 for xf = x + (x2 V 5) (mod 25) in counter mode. 23 3.2 Example of Theorem 3.4.2 for xf = x + (x2 V 5) (mod 25 ) in feedback mode. 24 4.1 Percentage of total runs and length of runs in the n-th bit slice of xf = x + (x2 V 5) (mod 2n) for various values of n. 33 4.2 Percentage of total runs and length of runs in the n-th bit slice of xf = x + (x2 V 5) (mod 2n) for various values of n (continued). 34 4.3 Length of bit patterns in the subsequence S2k of the keystream of xf = x + (x2 V 5) (mod 220) with initial state 0 and filtering function g1; autocorrelation values C(t) of the first half of the subsequence. 37 A.l Experimental values of C( ~) for a single cycle of the Klimov-Shamir keystream generator with n = 9 and various values of m in the filtering function 9m : Xi t---> [xi]n, . .. , [xi]n- m+l · . 49 vii LIST OF FIGURES 1.1 LFSR with three registers x1, x2, and x3 that satisfies the linear recur- rence Xn = Xn-l EB Xn- 3· ... ... · · · · · · · 5 2.1 C(t) for maximal length LFSR with 8 registers. 15 3.1 C(t) of the Klimov-Shamir keystream generator (see Chapter 4) with n = 16 and 91. 28 4.1 C(t) of the Klimov-Shamir keystream generator with n = 12 and 91· 35 4.2 C(t) of the Klimov-Shamir keystream generator with n = 14 and 91· 36 4.3 C(t) of the K-S shrinking generator with n = 16. .... .... 43 A.l C(t) of the Klimov-Shamir keystream generator with n = 10 and 91· 46 A.2 C(t) of t he Klimov-Shamir keystream generator with n = 12 and 91· 47 A.3 C(t) of the Klimov-Shamir keystream generator with n = 14 and 91· 47 A.4 C(t) of the Klimov-Shamir keystream generator with n = 16 and 91. 48 A.5 C(t) of the Klimov-Shamir keystream generator with n = 12 and 91 . 50 A.6 C(t) of the Klimov-Shamir keystream generator with n = 12 and 92· 50 A.7 C(t) of the Klimov-Shamir keystream generator with n = 12 and 93. 51 A .8 C(t) of the K-S shrinking generator with n = 10. 51 A.9 C(t) of the K-S shrinking generator with n = 12. 52 A.10 C(t) of the K-S shrinking generator with n = 14. 52 A.11 C(t) of t he K-S shrinking generator with n = 16. 53 Vlll ABSTRACT Stream ciphers are valuable in applications where efficiency and security are both needed. Linear feedback shift register sequences have been the mainstay of stream ciphers in the past. However, Alexander Klimov and Adi Shamir recently proposed a class of invertible T-functions as a possible source of cryptographic building blocks for stream ciphers. In particular, they present the mapping xf = x + (x2 V 5) (mod 2n) which is a permutation with a single cycle modulo 2n for any n. We discuss traditional stream cipher constructions and the desired properties of sequences produced by pseudorandom keystream generators. We then utilize these desired properties to analyze the aforementioned Klimov-Shamir keystream generator. Finally, we propose a possible construction for a keystream generator that combines a traditional stream cipher construction and the function proposed by Klimov and Shamir in order to produce a keystream that adheres to the desired properties we set forth. 1 CHAPTER 1. TRADITIONAL STREAM CIPHERS 1.1 One-time Pad- Motivation for Stream Ciphers Many stream ciphers provide a level of security that is suspect or untested. However, the concept of a stream cipher comes from Shannon's work with the one-time pad which is famous for its perfect security although infeasible key management. In using stream ciphers, we attempt to utilize the concept of the security of the one-time pad as well as developing a feasible key management scheme. First, let us examine the one-time pad. The one-time pad is an encryption scheme in which the key (which can only be used once- hence the name) is a random sequence that is at least as long as the message. For a simple example of how a one-time pad works, suppose a teacher needs to report a letter grade to a student. First, the teacher and student exchange a key at some point in time before they desire to have this secure communication. Let their common key K be the randomly produced bit string K = 11100110. Assume the teacher wants to tell the student that he received an 'A' in the class; the message is simply the ASCII code for the letter 'A' which is 01000001. In order to encrypt the message, the teacher simply takes the XOR of the key and the plaintext message. We will use the common notation of EB as the XOR operation, which is equivalent to bitwise addition modulo 2. Now the teacher has (11100110 EB 01000001) = 10100111 and gives the ciphertext message 10100111 to the student. The student simply applies his key to the ciphertext (i.e., 10100111) in order to decrypt the message. He now has (11100110 EB 10100111) = 01000001 which is the plaintext, and if he is familiar with ASCII encoding, he now knows his grade. If not, he may be slightly confused. If we consider this example, we can see that if K is kept secret, we gain no information about the plaintext from the ciphertext. Assume that we know the ciphertext C; make an 2 arbitrary guess M at the plaintext (notice that C and M should have the same length). For any guess M we can find a K that satisfies our encryption scheme. For each bit position Ci = 1 in the ciphertext, let the key bit ki be the complement of mi, and for each ciphertext bit Ci = 0, let ki = mi. The key K comprised of the ki satisfies M EB K = C. Therefore, if we have no information about the key, then we can do no better than guess any one of the possible messages. This amazing result leads us to the question, "Can we develop an encryption scheme with similar security but with reasonable key management?" The short answer is, "No, we cannot." However, the one-time pad has motivated the idea of using a pseudorandom number generator (PRNG) to produce a key for our cipher. If we can find a relatively efficient deterministic function that creates a sequence of bits that is indistinguishable from a bit sequence that has been randomly produced, t hen we have achieved the goal of creating a practical one-time pad.