AAAAnnnnaaaallllyyyyssssiiiissss ooooffff tttthhhheeee DDDDEEEESSSS aaaannnndddd tttthhhheeee DDDDeeeessssiiiiggggnnnn ooooffff tttthhhheeee LLLLOOOOKKKKIIII EEEEnnnnccccrrrryyyyppppttttiiiioooonnnn SSSScccchhhheeeemmmmeeee unicrest here A THESIS SUBMITTED TO THE DEPARTMENT OF COMPUTER SCIENCE UNIVERSITY COLLEGE, UNIVERSITY OF NEW SOUTH WALES AUSTRALIAN DEFENCE FORCE ACADEMY FOR THE DEGREE OF DOCTOR OF PHILOSOPHY By Lawrence Peter Brown 1991 ii c Copyright 1991 by Lawrence Peter Brown CCCCeeeerrrrttttiiiiffffiiiiccccaaaatttteeee ooooffff OOOOrrrriiiiggggiiiinnnnaaaalllliiiittttyyyy I hereby declare that this submission is my own work and that, to the best of my knowledge and belief, it contains no material previously published or written by another person nor material which to a substantial extent has been accepted for the award of any other degree or diploma of a university or other institute of higher learning, except where due acknowledgement is made in the text. I also hereby declare that this thesis is written in accordance with the University's Policy with respect to the use of Project Reports and Higher Degree Theses. Lawrence Peter Brown iii iv AAAAbbbbssssttttrrrraaaacccctttt This thesis will analyse some existing encryption algorithms used to provide secrecy in communications and data storage, and will detail the development of a new private key algorithm. It starts with a brief survey of modern encyption algorithms and their uses. It then takes a closer look at the RSA public key algorithm, with particular reference to its practical implementation. It shows that whilst RSA has some very desirable properties for use in public networks in that keys need not be exchanged previously, limitations in implementation speeds mean that RSA alone is not sufficient. Consequently a hybrid scheme is required which combines a public key scheme for authentication and key exchange, with a private key scheme for privacy. At present the DES algorithm is the sole certified private key scheme. It has been extensively analysed for possible weaknesses since its adoption in 1977. It is generally agreed that whilst the structure is sound, its key size of 56-bits has become too small with the improvements in computational speed on modern computers. Whilst the DES algorithm is public, its design criteria are classified. This thesis examines the design of the DES data encryption algorithm and related schemes, particularly with reference to the fundamental avalanche and completeness properties. From this is developed some possible design criteria for such schemes. Using these criteria, along with insights based on generic substitution-permutation cipher construction, suggestions and support from the authors colleagues, and with some results on substitution box design by Pieprzyk and Seberry, a new group of private key schemes, the LOKI family, is designed and presented as the major achievement of this thesis. v vi FFFFoooorrrreeeewwwwoooorrrrdddd To my supervisors Jennifer Seberry, Ah Chung Tsoi, and David Anderson, for their help, advice, support and encouragement both directly on the thesis material, and indirectly though their help in supporting this research environment. To the current and former members of the Department of Computer Science, and particularly to Geoff Collins, George Gerrity, Andrzej Goscinski, Mike and Cathy Newberry, Josef Pieprzyk, Rei Safavi-Naini, and Chris Vance for their support, help and suggestions. Thankyou. This work could not have been completed without the support of ARC grant A48830241, ATERB, and Telecom Australia contract 7027. To all of those organisations, thankyou for your encouragement of this research. vii viii CCCCoooonnnntttteeeennnnttttssss Chapter 1. Some Introductory Words .................. 1 1 Genesis and Goals of the Thesis ................... 1 2 Content of the Thesis ............................. 5 2.1 Main Thesis ..................................... 5 2.2 Appendices ...................................... 8 3 Other Work by the Author .......................... 9 4 Definitions ....................................... 10 Chapter 2. Data Encryption - an Introduction and Overview ....................................... 13 1 Introduction ...................................... 13 2 Modern Private-Key Cryptography ................... 13 2.1 Introduction .................................... 13 2.2 Fundamental Concepts ............................ 14 2.3 Lucifer ......................................... 17 2.4 DES ............................................. 20 2.5 DES Variants .................................... 24 2.6 FEAL ............................................ 24 2.7 Khufu, Khafre and Snefru ........................ 25 2.8 LOKI ............................................ 27 3 Public-Key Cryptography ........................... 27 3.1 Introduction .................................... 27 3.2 Public-Key Distribution Systems (PKDS) .......... 29 3.2.1 Description ................................... 29 3.2.2 Implementation ................................ 31 3.3 The Rivest-Shamir-Adleman (RSA) PKC ............. 32 3.3.1 An Overview of RSA ............................ 32 3.3.2 RSA Weaknesses and Related Schemes ............ 34 3.3.3 Implementation ................................ 35 4 Further Reading ................................... 36 5 Conclusions ....................................... 37 Chapter 3. Techniques for Implementing the RSA Public Key Cryptosystem ........................ 39 1 Introduction ...................................... 39 2 RSA Encryption and Decryption ..................... 39 3 RSA Key Generation ................................ 46 4 RSA Implementation in Practice .................... 49 4.1 Software Implementations of RSA ................. 49 4.2 Hardware Implementations of RSA ................. 50 5 Conclusion ........................................ 51 Chapter 4. Design Rules for the DES ................. 53 1 Introduction ...................................... 53 ix x 2 Description of the DES ............................ 53 3 Known DES Design Criteria ......................... 54 3.1 S-box Design Criteria ........................... 54 3.2 P-box Design Criteria ........................... 56 3.2.1 IP and IP-1 ................................... 56 3.2.2 PC1 ........................................... 57 3.2.3 P and E ....................................... 57 3.2.4 PC2 ........................................... 59 3.3 Key Scheduling .................................. 60 4 Ciphertext Dependency Analysis .................... 61 4.1 Ciphertext Dependence of Plaintext Bits ......... 61 4.2 Ciphertext Dependence on Key Bits ............... 62 5 Design of new DES style Ciphers ................... 65 5.1 S-box Redesign .................................. 65 5.2 P-box Redesign .................................. 66 5.3 Key Scheduling Extension ........................ 67 5.4 Dependency Analysis of An Extended DES .......... 68 6 Conclusion ........................................ 68 Chapter 5. On the Design of Permutation P in Feistel Ciphers ................................ 71 1 Introduction ...................................... 71 2 Empirical P-box Design Criteria ................... 71 3 Further Analysis of the Design of Permutation P ................................................ 74 4 Analysis of the Best Latin-Square Permutations P ................................................ 75 5 A Regular Form for Permutation P .................. 77 6 A Further Criterion for Best Permutations ......... 78 7 Design Rules for Permutation P .................... 79 8 Regular Permutations P in Feistel Ciphers ......... 80 9 Conclusion ........................................ 81 Chapter 6. Key Scheduling in Feistel Ciphers ........ 83 1 Introduction ...................................... 83 2 The Key Schedule in DES ........................... 83 3 Empirical Key Schedule Design Criteria ............ 84 4 Ciphertext Dependence on Key Bits ................. 85 5 Alternatives for the Key Schedule ................. 85 6 Some Trials on New Key Schedules .................. 86 7 Design Criteria for New Key Schedules ............. 89 8 An Alternative Key Schedule Design ................ 90 9 Conclusion ........................................ 91 Chapter 7. LOKI - A Cryptographic Primitive for Authentication and Secrecy Applications ........ 93 1 Introduction ...................................... 93 1.1 Overview ........................................ 94 1.2 Encryption ...................................... 95 1.3 Decryption ...................................... 97 1.4 Function f ...................................... 97 xi 2 Design Philosophy ................................. 100 2.1 Overall LOKI Algorithm Design ................... 100 2.2 Overall Design, Permutation P, E, and the Key Schedule ....................................... 102 2.3 Key Representation and Choice ................... 105 2.4 LOKI S-boxes .................................... 106 2.5 Selection of Alternate Substitution Functions S .............................................. 109 3 Additional Modes of Use ........................... 112 3.1 Single Block Hash (SBH) Mode ................... 112 3.2 Double Block Hash (DBH) Mode .................... 113 4 Performance and Implementations ................... 114 4.1 Software Implementation ......................... 114 4.2 Hardware Implementation ......................... 115 5 Conclusion ........................................ 115 Chapter 8. Conclusion ............................... 118 1 Results Obtained in this Thesis ................... 118 2 Assumptions and Limitations of the Research ....... 121 3 Suggestions for Further Research .................. 122 Appendix A. Analysis of the LOKI Primitive .......... 123 1 LOKI Dependency Analysis .......................... 123 1.1 LOKI CPdep Analysis ............................. 125 1.2 LOKI CKdep Analysis ............................. 129 2 Analysis of the LOKI S-Boxes ...................... 133 Appendix B. Dependency Analysis Programs ............ 137 1 cp_dep.c .......................................... 137 2 ck_dep.c .......................................... 142 Appendix C. LOKI - Sample Implementation ............ 150 1 Overall Program Structure ......................... 150 2 Test Data ......................................... 151 3 Program Listings .................................. 154 Bibliography ........................................ 171 xii IIIInnnnddddeeeexxxx ooooffff FFFFiiiigggguuuurrrreeeessss Fig 1.1 - The Need for Privacy ...................... 1 Fig 1.2 - The Need for Authentication ............... 2 Fig 1.3 - Private-Key Cryptosystems ................. 3 Fig 1.4 - Public-Key Cryptosystems .................. 4 Fig 2.1 - Substitution Operation .................... 14 Fig 2.2 - Permutation Operation ..................... 15 Fig 2.3 - Sample S-P Network, with Avalanche Characteristic ................................. 16 Fig 2.4 - A Round of a Feistel Cipher ............... 17 Fig 2.5 - Lucifer ................................... 18 Fig 2.6 - Lucifer Function f ........................ 19 Fig 2.7 - DES Enciphering ........................... 20 Fig 2.8 - DES Function g ............................ 22 Fig 2.9 - DES Key Scheduling ........................ 23 Fig 5.1 - DES as a Mixing Function .................. 72 Fig 7.1 - LOKI Encryption Computation ............... 95 Fig 7.2 - LOKI Function _f Detail .................... 99 Fig 7.3 - LOKI S-Box Detail ......................... 100 Fig 7.4 - LOKI Single Block Hash (SBH) .............. 113 Fig 7.5 - LOKI Double Block Hash (DBH) .............. 114 xiii xiv IIIInnnnddddeeeexxxx ooooffff TTTTaaaabbbblllleeeessss Table 2.1 - Key Schedule for DES .................... 23 Table 3.1 - Complexity of Factorization and Exponentiation Operations Mod R ................ 40 Table 3.2 - Example of Long-hand Multiplication ..... 40 Table 3.3 - Number and Remainder (mod 517) .......... 42 Table 3.4 - Example of Modulo Reduction ............. 42 Table 4.1 - P.E Permutation ......................... 58 Table 4.2 - Worst Case DES P ........................ 61 Table 4.3 - Dependency of Ciphertext bits on Plaintext bits in DES .......................... 62 Table 4.4 - Dependency of Ciphertext bits on Key bits in DES with Current PC2 ................... 63 Table 4.5 - Dependency of Ciphertext bits on Key bits in DES with Worst Case PC2 ................ 64 Table 4.6 - Dependency of Ciphertext bits on Key bits in DES with Sample PC2 .................... 64 Table 4.7 - Sample DES PC2 .......................... 64 Table 4.8 - Sample Extended DES P ................... 66 Table 4.9 - Sample Extended DES PC2 ................. 67 Table 4.10 - Key Schedule for an Extended DES ....... 67 Table 4.11 - Dependency of Ciphertext bits on Plaintext bits in Extended (128-bit) DES with a Sample PC2 ................................... 68 Table 4.12 - Dependency of Ciphertext bits on Key bits in Extended (128-bit) DES with a Worst Case PC2 ....................................... 69 Table 4.13 - Dependency of Ciphertext bits on Key bits in Extended (128-bit) DES with a Sample Regular PC2 .................................... 69 Table 4.14 - Worst Case Extended DES P .............. 70 Table 4.15 - Worst Case Extended DES PC2 ............ 70 Table 5.1 - P.E Permutation ......................... 73 Table 5.2 - Worst Case DES P ........................ 74 Table 5.3 - Dependency of Ciphertext on Plaintext Bits for various DES permutations P by Round ................................................ 75 Table 5.4 - Fixed Columns in Sample Permutations P ................................................ 76 Table 5.5 - Best Latin-Square Permutations P ........ 77 Table 5.6 - Best Regular Form Permutations P ........ 78 Table 5.7 - Dependency of Ciphertext bits on Plaintext bits via Message, Autoclave and Both Inputs .................................... 78 Table 5.8 - Best Latin Square Permutations P by both Ciphertext-Plaintext and Ciphertext-Key xv xvi Dependence ..................................... 79 Table 5.9 - Best Regular Form Extended Permutations P ................................. 80 Table 5.10 - Dependency of Ciphertext bits on Plaintext bits in Extended (128-bit) DES ....... 80 Table 6.1 - Key Schedule for DES .................... 83 Table 6.2 - Current DES Permutation PC2 ............. 84 Table 6.3 - Form of generated Permutations PC2 ...... 86 Table 6.4 - Dependency of Ciphertext bits on Key bits Using Current DES Permutation P and Key Schedule ....................................... 87 Table 6.5 - Dependency of Ciphertext bits on Key bits Using Current DES Permutation P and Key Schedule by Both Message and Autoclave S-box Inputs ......................................... 88 Table 6.6 - Trial Key Schedules ..................... 89 Table 6.7 - Null and Local Permutations PC2 for Alternative Key Schedule ....................... 90 Table 6.8 - Alternative Constant Key Rotation Schedule ....................................... 90 Table 6.9 - Dependency of Ciphertext bits on Key bits Using Current DES Permutation P and the Alternative Key Schedule by Both Message and Autoclave S-box Inputs ......................... 91 Table 7.1 - LOKI Expansion Function E ............... 98 Table 7.2 - LOKI S-box .............................. 99 Table 7.3 - LOKI Permutation P ...................... 100 Table 7.4 - LOKI Key Schedule Overview .............. 104 Table 7.5 - Dependency of Ciphertext bits on Plaintext and Key bits by Both Message and Autoclave S-box Inputs ......................... 105 Table 7.6 - LOKI S-box Non-linearity for the Boolean function of all Input Bits to each Output bit ..................................... 109 Table 7.7 - LOKI - S-box Analysis ................... 109 Table 7.8 - Irreducible Polynomials for LOKI S- boxes .......................................... 110 Table 7.9 - Exponents Inverse Pairs Available for use in the LOKI S-boxes ........................ 111 0 CCCCHHHHAAAAPPPPTTTTEEEERRRR 1111 SSSSoooommmmeeee IIIInnnnttttrrrroooodddduuuuccccttttoooorrrryyyy WWWWoooorrrrddddssss _1. _G_e_n_e_s_i_s _a_n_d _G_o_a_l_s _o_f _t_h_e _T_h_e_s_i_s Cryptography, the study of secret writing, has a long his- tory which until recently has been primarily associated with military and government needs. Cryptography has two major purposes. The first is the provision of _p_r_i_v_a_c_y by concealing the contents of some message from _e_a_v_e_s_d_r_o_p_p_e_r_s who are not intended to be able to read it (Fig 1.1). This has been the traditional application of cryptography. FFFFiiiigggg 1111....1111 ---- TTTThhhheeee NNNNeeeeeeeedddd ffffoooorrrr PPPPrrrriiiivvvvaaaaccccyyyy However, with the increasing use of electronic media, there has been a developing need for an electronic equivalent of the written signature. This addresses the need for _a_u_t_h_e_n_t_i_c_a_t_i_o_n, of proving who has sent a given message, such as legal contracts, letters, etc. in a manner that they cannot subsequently repudiate (Fig 1.2). Both of these aspects are important in modern commercial cryptography. 1 2 FFFFiiiigggg 1111....2222 ---- TTTThhhheeee NNNNeeeeeeeedddd ffffoooorrrr AAAAuuuutttthhhheeeennnnttttiiiiccccaaaattttiiiioooonnnn Traditional cryptographic schemes have relied on a series of _s_u_b_s_t_i_t_u_t_i_o_n (where letters or words are replaced by others), and _t_r_a_n_s_p_o_s_i_t_i_o_n or _p_e_r_m_u_t_a_t_i_o_n (where the order of letters or words is changed) operations to conceal the message. The particular substitution or transposition used is controlled by a _k_e_y. This key is used by both the sender and the recipient of the concealed mesage, and hence has to be kept secret in order to protect the secrecy of the message. Such schemes are called _P_r_i_v_a_t_e- _K_e_y _C_r_y_p_t_o_s_y_s_t_e_m_s for this reason (Fig 1.3). The need to exchange keys via a trusted courier, and to keep them secret, was manageable whilst the communications channels were restricted to well defined miltary or diplomatic hierarchies. However the explosion of electronic communications media, the rise of Electronics Funds Transfer (EFT), and the need for secure communications in business and the public in electronic mail schemes, have all lead to a need for some alternative scheme where this previous exchange of keys is not needed. Since the number of keys which would need to be exchanged grows as the square of the number of partici- pants, this soon becomes infeasible. What is needed is the ability to be able to publish an encryption key (used either to conceal the message, or to verify a signature) in the equivalent of a telephone directory, without compromising the decryption key (used to restore the mes- sage or create a signature), and hence the security of the message. Such schemes are called _P_u_b_l_i_c-_K_e_y _C_r_y_p_t_o_s_y_s_- _t_e_m_s, or _T_w_o-_K_e_y _C_r_y_p_t_o_s_y_s_t_e_m_s (Fig 1.4). They were ori- ginally proposed in a pivotal paper by Diffie and Hellman Chapter 1 3 [DiH76], who developed these concepts, and proposed a pos- sible scheme; and also independently by Merkle [Mer78] who outlined the basic concepts, but did not propose a feasi- ble system. FFFFiiiigggg 1111....3333 ---- PPPPrrrriiiivvvvaaaatttteeee----KKKKeeeeyyyy CCCCrrrryyyyppppttttoooossssyyyysssstttteeeemmmmssss Ideally, public-key cryptosystems should be able to pro- vide all the features desired in a secure communications system. However, as shown in Chapter 3, limitations in the implementation speed of such schemes at present restrict their usefulness to authentication and key exchange (important though these are). Consequently there is a need for hybrid schemes which use a public-key cryptosys- tem to exchange session keys and to sign messages, and a private-key cryptosystem to efficiently encrypt the mes- sage for privacy. This implies a need for good modern private keys schemes, preferably a number of different schemes which may be employed in applications of varying sensitivity in the commercial and government confidential areas. Current schemes in use are either proprietry, or are felt to have key sizes which are too small. The remainder of this thesis details the development of a good new private key scheme, which is the major achievement of this thesis. Chapter 1 4 FFFFiiiigggg 1111....4444 ---- PPPPuuuubbbblllliiiicccc----KKKKeeeeyyyy CCCCrrrryyyyppppttttoooossssyyyysssstttteeeemmmmssss To achieve this, the Data Encryption Standard (DES) [NBS77] is analysed in detail as a source of insights to be used in the design of the new cipher. DES has achieved wide utilization, particularly in the banking and elec- tronic funds transfer areas, where it is now an Australian standard [ASA85]. At the time of its introduction there was a considerable amount of controversy, primarily with the choice of a 56-bit key [DiH77], [Hel79a]. This was on the grounds that such a key length was small enough to be exhaustively searched on machines which could be con- structed in the foreseeable future. With the march of computer technology, this risk appears to be rising. How- ever, on all other accounts DES appears to be an excellent cryptosystem. The DES has withstood a concerted analysis by the open research community, since its adoption in 1977. The most successful attack to date, that of Biham and Shamir [BiS90] still performs worse than an exhaustive key-space search on the DES with the full 16 rounds. With the current significant use of DES (especially in banking), there is interest in designing and building a DES-type cryptosystem with an extended key length, for several reasons. These include: +o Doubts about the ability of DES to withstand an attack based on exhaustive key-space searches on specialised hardware (cf. the decision of the US NBS to withdraw certification of DES for all but banking applications). This may be overcome by increasing Chapter 1 5 the key length. +o The difficulty in obtaining DES systems outside the US, due to export restrictions. +o The desire to develop a scheme for which all the design criteria used are known, and hence open to criticism. Given these reasons, and the confidence with which the DES is otherwise regarded, it was felt to be suitable for analysis to derive some design rules. Whilst the DES algorithm is public, its design criteria are classified. This thesis examines the design of the DES data encryption standard, and develops some possible design criteria for it in Chapters 4, 5 and 6. Using these criteria, along with insights based on generic substitution-permutation cipher construction, suggestions and support from the authors colleagues, and with some results on substitution box design by Pieprzyk and Seberry [PiF89], [Pie90], [Pie89], [PiS89], a new group of private key schemes, the LOKI family is designed. This development is detailed in Chapter 7. A preliminary analysis of one of the members of this family is then given. The appendices of this thesis present the detailed results from the analysis of one of the LOKI ciphers; the code used for the dependency analysis programs; and a sample LOKI cipher implementa- tion. _2. _C_o_n_t_e_n_t _o_f _t_h_e _T_h_e_s_i_s _2._1. _M_a_i_n _T_h_e_s_i_s The detailed contents of each chapter are as follows. Chapter 1 is this overview of the thesis. Chapter 2 surveys the field of cryptography, providing an overview of the modern private and public key cryptosys- tems used to provide privacy and authentication. It con- trasts their strengths and weaknesses, and briefly describes a number of schemes either in use, or proposed for use. These algorithms form the basis against which further algorithm development will be compared. Chapter 3 examines the RSA public key cryptosystem, which at present is generating considerable interest as a scheme with a wide range of potential uses. Indeed, it has already been adopted to provide authentication in EFT application in the UK. However, its practical use for providing secrecy has been limited because of the time Chapter 1 6 taken to perform its essential encryption and decryption functions. Whilst the times achieved to date are suffi- ciently short for key exchange and authentication schemes, they are not fast enough for encrypting data to provide privacy. Thus in the near term, practical schemes will very likely use hybrid systems. These use a public key algorithm to exchange session keys, and to provide authen- tication and non-repudiation of messages, and a fast private key scheme to provide privacy. This chapter con- cludes that whilst public key schemes would seem to be the obvious realm of research into cryptographic algorithms because of their advantages in public networks, present limitations indicate that good private key schemes are still required. This chapter includes material previously presented to the "Secure Data Communications Workshop", organized by the IEEE Communications Section, Victorian Branch, held at the Town House, Melbourne, on 31st July 1987 [Bro87]. Chapter 4 examines the Data Encryption Standard DES. This is the most widely used private key encryption system at present, especially in the financial industry. Though there were some initial doubts about the design of DES, it has withstood considerable analysis by the open research community since its adoption in 1977. The design of the DES is regarded as sound, though the size of key is thought to be too small. Whilst DES is a standard, the design criteria used in its development have been classi- fied by the US government. Because of this, and of increasing doubts about the ability of DES to withstand an attack based on an exhaustive key-space search using specialised hardware, there is considerable interest in developing an encryption scheme for which the design rules used are known, and hence open to analysis and criticism. This is the primary goal of this thesis. In order to achieve this, a detailed examination of the DES is done, since its design has withstood the test of time. This chapter reviews what is known about the design criteria for the S-boxes, P-boxes, and key scheduling in the current DES. It then presents some initial observations by the author on possible design rules for the permutations P, PC2, and the key rotation schedule KS in the DES. It then indicates how this information could be used to design new private key schemes with either full 64-bit keys (instead of the 56-bits used in the DES), or with double length keys of 128-bits. This chapter includes material previously presented to IFIP Sec'88, held on the Gold Coast, Australia, in May 1988, and subsequently pub- lished in [Bro89]. Chapter 1 7 The next two chapters examine two key components of the DES structure in more detail: the permutations P and PC2 and the key schedule KS. Chapter 5 develops some design criteria for the permuta- tion P in a DES style cryptosystem. This permutation pro- vides the diffusion component of a substitution- permutation network. Some empirical rules which seem to account for the derivation of the permutation used in the DES are first presented. The author then notes that these permutations may be regarded as latin-squares which link the outputs of S-boxes to their inputs at the next stage. A subset of these with a regular structure, and which per- form well in a dependency analysis are then presented. The author then generalises the design rules for permuta- tion P. These rules will be used later in Chapter 7 in the design of the LOKI algorithm. This chapter includes material previously presented to Eurocrypt '89 in Houthalen, Belgium, in April 1989, and published in [BrS90a]. Chapter 6 develops some design criteria for the key schedule in a DES style cryptosystem. The key schedule involves a Key Rotation component KS, and the permutation PC2. Together these provide for a diffusion of dependency of ciphertext bits on key bits. Some empirical rules which seem to account for the derivation of the key schedule used in the DES are first presented. A number of trials were run with various key schedules, and some further design rules were derived. An alternative form of key schedule was then tested. This used either a null PC2, or one in which permutations only occurred within the inputs to a given S-box, and a much larger rotation schedule than used in the DES. This was found to be as effective as the key schedule used in the current DES, and is proposed for use later in Chapter 7 in the design of the LOKI algorithm. This chapter includes material previ- ously presented to Auscrypt '90, in Sydney, Australia, in January 1990, and published in [BrS90b]. Chapter 7 presents the major achievement of this thesis. It provides an overview of the LOKI encryption algorithm which may be used to encrypt and decrypt a 64-bit block of data using a 64-bit key. It was developed by the author and his colleagues Professor Jennifer Seberry and Dr. Josef Pieprzyk. The structure of the LOKI encryption algorithm was designed by the author based on the general design principles developed in the previous chapters. The design principles for selecting S-boxes developed by Pieprzyk and Seberry [PiF89], [Pie90], [Pie89], [PiS89] were used in the design of the S-boxes used in LOKI. This Chapter 1 8 chapter completely details the proposed publicly standar- dised version of the LOKI cipher. It also describes how customised versions of the cipher may be constructed which are believed to have the same degree of security as the standard version of the cipher. The author then summar- ises the encouraging results from the initial testing of the LOKI cipher, details of which are given in Appendix 1. The LOKI cipher may be used in any mode of operation currently defined for DES, with which it is interface com- patible [AAA83]. In addition, the author has adapted two modes of operation of LOKI which compute a 64-bit or 128- bit Message Authentication Code (or hash values) respec- tively, from previous work by Davies and Price [DaP89], Winternitz [Win83], and Quisquater and Girault [QuG90]. These modes of operation may be used to provide authenti- cation of a communications session, or of data files. Finally the author presents some observations about the likely performance of the LOKI cipher in both software and hardware implementations, which show that it compares extremely favorably against the alternatives. This chapter includes material previously presented to Auscrypt '90, in Sydney, Australia, in January 1990, and published in [BrS90b]. Versions of this material have also been sup- plied to the European RIPE consortium [BPS89], to Stan- dards Australia, and to the Defence Signals Directorate, for evaluation. Chapter 8 summarises the results and achievements of this thesis, as described in the preceeding chapters. _2._2. _A_p_p_e_n_d_i_c_e_s The Appendices of this thesis comprise the detailed results from the analysis of the LOKI algorithm; the C program source for the DES dependency analysis programs; and the C program source for a sample implementation of the LOKI algorithm. Appendix 1 presents the detailed results from the depen- dency analysis and preliminary statistical analysis of LOKI cipher. Appendix 2 contains a listing of two programs ccccpppp____ddddeeeepppp and cccckkkk____ddddeeeepppp, which perform a dependency analysis of output bits on input and key bits for a DES like cipher. This analysis provides a measure of effectiveness of the permutations P, PC2, and the key schedule KS, in achieving the avalanche and completeness properties. This was used as a measure of effectiveness in evaluating variations of the permuta- tions P, PC2, and the key schedule KS in DES like schemes, and in LOKI, in the development of the design criteria. In Chapter 1 9 detail, the programs are: cp_dep.c builds a dependency matrix for each ciphertext bit, based on plaintext bits, for a given P. It assumes that the S-boxes provide an adequate degree of confu- sion sufficient to ensure that all outputs are depen- dent on all inputs, and that the S-Box outputs are all equivalent. It takes as input a permutation P to use in the cipher structure being analysed. ck_dep.c builds a dependency matrix for each ciphertext bit, based on keytext bits, for a given P, PC2 and key schedule. It assumes that the S-boxes provide an adequate degree of confusion sufficient to ensure that all outputs are dependent on all inputs, and that the S-Box outputs are all equivalent. It takes as input permutations P, and PC2, and a key schedule KS to use in the cipher structure being analysed. Appendix 3 contains a listing of a sample implementation of the LOKI cipher. These implement the first (small but slow) of the possible software implementations identified in Chapter 7. _3. _O_t_h_e_r _W_o_r_k _b_y _t_h_e _A_u_t_h_o_r During the period when the work detailed in this thesis was being developed, the author was engaged in a couple of other related projects which may be of interest. One discusses some alternative approaches to providing security in remote terminal sessions. Since remote termi- nal sessions mean that information is carried over a net- work that may not be trusted, there is a need for mechan- isms to protect the security of information exchanged dur- ing the session. The protocols implemented will need to address the issues of authentication of the parties, nego- tiation of a suitable cipher to use, and the exchange of keys for that cipher. This paper examines each of these issues, describes a prototype implementation incorporating some of these features in the sssseeeecccclllloooogggg program, and finishes with a description of work in progress on extending the widely used tttteeeellllnnnneeeetttt protocol to incorporate some of these security features. This material was presented to AUUGC'90, World Trade Centre, Melbourne, Victoria, Aus- tralia 26th - 28th September, 1990 [Bro90b], [Bro90]. The other project surveys the various alternatives avail- able for the provision of a Pay-TV service in Australia. Chapter 1 10 In particular, the technical alternatives available for the delivery, transmission, scrambling and key management components are presented. A selection of systems in, or proposed for use are then compared. This material was published in [Bro90a]. _4. _D_e_f_i_n_i_t_i_o_n_s Within this thesis, the following definitions apply: Algorithm a clearly specified mathematical process for computa- tion; a set of rules which, if followed, will give a prescribed result. Autoclave a process of incorporating information from the mes- sage input to an encryption algorithm into the key scheduling of that algorithm. Thus different message inputs result in different keying choices in the various stages of the algorithm. This is usually acomplished by using some message bits as inputs to both the key selection as well as the message substi- tution parts of the algorithm. Avalanche Property of a function implies that a change in an input bit should result in approximately half of the output bits changing [Fei73]. Bit Numbering bits within a 64-bit block b are numbered from 63 to 0, left to right, MSB to LSB, and denoted [b b ...b b ]. The bits within a 32-bit block are nu6m3be6r2ed l1ik0ewise from 31 to 0, ie the string 10010 represents the number eighteen. When used to represent a polynomial in a Galois field, a block is interpreted as having the left most bit being the most significant. ie the string 100011011 represents the polynomial x8+x4+x3+x+1. Ciphertext clear text that has been encrypted. Cleartext intelligible text or signals that have meaning and that can be read and used. Completeness Property of a function implies that each output bit must be a complex function of all input bits [KaD79]. Chapter 1 11 Concatenation of two blocks L and R of 32 bits, denoted L | R, will result in LR a 64-bit block consisting of the bits of L followed by the bits of R. Confusion a term coined by Shannon [Sha49] to describe a func- tion whose output is a complex function of its inputs (usually composed of a data block and a sub-key). Diffusion a term coined by Shannon [Sha49] to describe a linear function whose output is a permutation (or wire- crossing) of its inputs, and which distributes input bits so as to remove any local clustering. Data Encryption Algorithm (DEA) an algorithm designed to encrypt and decrypt blocks of data. Decryption the transformation of ciphertext into cleartext. Encryption the transformation of cleartext into ciphertext for the purpose of security or privacy. Encryption algorithm a set of mathematically expressed rules for rendering information unintelligible, by effecting a series of transformations to the normal representation of the information, through the use of variable elements controlled by the application of a key. Galois Field denoted GF(pn), is an extension of degree n of GF(p). In particular, this thesis refers to binary fields, eg GF(28). Initialization Vector a binary vector used in the initial input block in cipher block chaining mode of operation. Key a 64-bit quantity which is used for transformations between ciphertext and cleartext. LOKI the name of the DEA being developed in this thesis. Modulo 2 addition a mathematical operation equivalent to binary Chapter 1 12 addition without carry. Sometimes referred to as an 'exclusive OR' operation. Non-Linearity of a function f, belonging to the set F of all Boolean functions of n Boolean variablnes, is the minimum Hamming distance between f and the set of all linear Boolean functions L existing in F [Pie90], [Pie89]. n n Permutation a function that reorders a set of n input bits. It may be described by a table of size n. nb: this usage differs from that of Pieprzyk, for whom this term is a synonym for substitution. ROL(B,n) the operation of rotating a block B n places to the left, with wraparound from the MSB to LSB. ie; b becomes b , b becomes b etc. 0 n 1 n+1 ROR(B,n) the operation of rotating a block B n places to the right, with wraparound from the LSB to MSB. ie; b becomes b , b becomes b etc. n 0 n+1 1 Substitution a function mapping a set of m bit input words onto a set of n bit output words. It may be described by a table of size 2m. Chapter 1 CCCCHHHHAAAAPPPPTTTTEEEERRRR 2222 DDDDaaaattttaaaa EEEEnnnnccccrrrryyyyppppttttiiiioooonnnn ---- aaaannnn IIIInnnnttttrrrroooodddduuuuccccttttiiiioooonnnn aaaannnndddd OOOOvvvveeeerrrrvvvviiiieeeewwww _1. _I_n_t_r_o_d_u_c_t_i_o_n This chapter provides an overview of some modern encryp- tion algorithms, both private and public key. It will describe the general framework within which these schemes have been developed, briefly detail a number of algo- rithms, and then describe in detail two particular schemes: DES and RSA. These have been chosen as the two algorithms generating the most interest in the private and public-key realms respectively. The aim of this chapter is to establish the background against which the remainder of the thesis will be developed. In particular it intends to describe the theoretical framework, so far as is known, that has been used to design the DES and RSA algorithms. In the remainder of this thesis the author will be extending that analysis, ultimately using it to develop a new family of private key algorithms. As described earlier, encryption algorithms may be cata- gorised into two broad families. Private key (one-key) algorithms in which both sender and recipient share a com- mon secret key for both encryption and decryption; and public key (two-key) algorithms in which the sender uses a well known public encryption key, whilst the recipient uses a secret decryption key. These classes will be detailed separately. _2. _M_o_d_e_r_n _P_r_i_v_a_t_e-_K_e_y _C_r_y_p_t_o_g_r_a_p_h_y _2._1. _I_n_t_r_o_d_u_c_t_i_o_n With the advent of computers, data encryption schemes underwent a revolutionary change. The use of computers enabled the cracking of hitherto secure schemes, but also enabled the implementation of schemes which until then were too complex for use by a manual cipherclerk. Based on the work of Shannon [Sha49], a new family of cryptosys- tems, known as _S_u_b_s_t_i_t_u_t_i_o_n-_P_e_r_m_u_t_a_t_i_o_n _n_e_t_w_o_r_k_s were developed. These led to the development of a system known as LLLLuuuucccciiiiffffeeeerrrr, at the IBM Research Laboratories [Fei73], and subsequently to the DDDDaaaattttaaaa EEEEnnnnccccrrrryyyyppppttttiiiioooonnnn SSSSttttaaaannnnddddaaaarrrrdddd ((((DDDDEEEESSSS)))) 13 14 [NBS77]. DES has since achieved wide utilization, particu- larly in the banking and electronic funds transfer areas, where it is now a standard in a number of countries including the USA [NBS77], [Ins81], [AAA83], and Australia [ASA85]. _2._2. _F_u_n_d_a_m_e_n_t_a_l _C_o_n_c_e_p_t_s In designing cryptographic algorithms, there are two basic cryptographic primitives: _s_u_b_s_t_i_t_u_t_i_o_n and _t_r_a_n_s_p_o_s_i_t_i_o_n (or _p_e_r_m_u_t_a_t_i_o_n). In a substitution function, each char- acter is replaced by some other character (see example instance in Fig 2.1). FFFFiiiigggg 2222....1111 ---- SSSSuuuubbbbssssttttiiiittttuuuuttttiiiioooonnnn OOOOppppeeeerrrraaaattttiiiioooonnnn The particular substitution used is selected by some _k_e_y. If characters are represented by a small number of bits, then such a scheme may be defeated by enumerating all pos- sible cases to find the substitution used. If made suffi- ciently large and a suitably complex function is used, such a scheme is in practice unbreakable, since it would require the enumeration of all n! cases (where n is the number of possible characters). Unfortunately it is also unworkable, since the number of permutations, and hence keys, would be equally large. Traditionally, in a transposition function a set of char- acters were permuted (rearranged) into a new order, again with the particular rearrangement selected by some key. In modern implementations, this becomes a permutation of bits or a wire-crossing (see example instance in Fig 2.2). Chapter 2 15 FFFFiiiigggg 2222....2222 ---- PPPPeeeerrrrmmmmuuuuttttaaaattttiiiioooonnnn OOOOppppeeeerrrraaaattttiiiioooonnnn Since the complexity of such an operation is only linear in the number of bits used, it may be easily broken by testing each bit in turn to find its new location. It also implies that it is easy to build such a function for large numbers of bits. Because of these weaknesses in both the basic primitives, the concept of _p_r_o_d_u_c_t _c_i_p_h_e_r_s arose, whereby a series of substitution and transposition functions were combined to form a function which is much more secure than any of its components. Prior to the introduction of rotor machines, only simple product ciphers were possible. The develop- ment of rotor machines, and subsequently computers, changed this significantly. Shannon [Sha49], in a key paper, described a particular class of product ciphers which used a number of small (and hence implementable) substitution boxes, termed S-boxes, connected by large permutation boxes, termed P-boxes (see Fig 2.3). He termed these _m_i_x_i_n_g _t_r_a_n_s_f_o_r_m_a_t_i_o_n_s, whereby the S-boxes provided _c_o_n_f_u_s_i_o_n of the input, and the P- boxes provide _d_i_f_f_u_s_i_o_n of the S-box outputs across the inputs to the next stage. Such schemes are now termed _S_u_b_s_t_i_t_u_t_i_o_n-_P_e_r_m_u_t_a_t_i_o_n (_S-_P) _n_e_t_w_o_r_k_s. Chapter 2 16 FFFFiiiigggg 2222....3333 ---- SSSSaaaammmmpppplllleeee SSSS----PPPP NNNNeeeettttwwwwoooorrrrkkkk,,,, wwwwiiiitttthhhh AAAAvvvvaaaallllaaaannnncccchhhheeee CCCChhhhaaaarrrraaaacccctttteeeerrrriiiissssttttiiiicccc Two key properties of such S-P networks are the _a_v_a_l_a_n_c_h_e property, identified by Feistel [Fei73]; and the _c_o_m_p_l_e_t_e_- _n_e_s_s property, identified by Kam and Davida [KaD79]. The avalanche property states that changing one input bit should result in approximately half of the output bits changing. The completeness property states that each out- put bit must be a complex function of every input bit. These properties appear to be important criteria for pro- viding cryptographic strength in the resultant system. More formally, these are defined (see [WeT86]) as follows. A function f has a good _a_v_a_l_a_n_c_h_e effect if: m for each bit i, 0m_ +o and keeps secure the private key D = . Chapter 2 33 A sender can encrypt a message M (expressed as some large integer of a size less than the length of the modulus used in the system, and created by concatenating characters together to form a bit-string of the appropriate length) to form the ciphertext C using the public encryption key by calculating: C = Me (mod R), 0 _< C < R (Eq 2.8) The receiver can then decipher this using his private decryption key by calculating: M = Cd (mod R) (Eq 2.9) The system relies on the following well known number theoretic identity (Euler's generalization of Fermat's theorem): If GCD(X,R) = 1, (Eq 2.10) then XU(R) _= 1 (mod R) hence Cd = Med _= M1+nU(R) _= M1MnU(R) _= M1 _= M (mod R). RSA can also be used as a signature scheme since the encryption and decryption operations are commutative. That is, a sender can create a signature S for a message M using their private key (which only they have access to), by calculating: S = Md (mod R) (Eq 2.11) which may be verified by anyone using the sender's public key (obtained from the public directory), by calcu- lating: M = Se (mod R), (Eq 2.12) The signature can then be encrypted using the recipient's public key, in order to privately transfer it to the reci- pient. Chapter 2 34 _3._3._2. _R_S_A _W_e_a_k_n_e_s_s_e_s _a_n_d _R_e_l_a_t_e_d _S_c_h_e_m_e_s There is a minor problem known as the signature reblocking problem, which must be overcome when the same scheme is used for both secrecy and authentication. It occurs because each user has modulii R of different sizes, and hence a block of ciphertext in one user's field may not be a valid block in the other users field. This becomes a problem when user A signs a message for B, and then wishes to protect its privacy by encrypting with B's public key. If user A's field is larger than B's, and the signed mes- sage also turns out to be too large (ie R < S