Amy Bell Abilene, TX December 2005
Total Page:16
File Type:pdf, Size:1020Kb
Compositional Cryptology Thesis Presented to the Honors Committee of McMurry University In partial fulfillment of the requirements for Undergraduate Honors in Math By Amy Bell Abilene, TX December 2005 i ii Acknowledgements I could not have completed this thesis without all the support of my professors, family, and friends. Dr. McCoun especially deserves many thanks for helping me to develop the idea of compositional cryptology and for all the countless hours spent discussing new ideas and ways to expand my thesis. Because of his persistence and dedication, I was able to learn and go deeper into the subject matter than I ever expected. My committee members, Dr. Rittenhouse and Dr. Thornburg were also extremely helpful in giving me great advice for presenting my thesis. I also want to thank my family for always supporting me through everything. Without their love and encouragement I would never have been able to complete my thesis. Thanks also should go to my wonderful roommates who helped to keep me motivated during the final stressful months of my thesis. I especially want to thank my fiancé, Gian Falco, who has always believed in me and given me so much love and support throughout my college career. There are many more professors, coaches, and friends that I want to thank not only for encouraging me with my thesis, but also for helping me through all my pursuits at school. Thank you to all of my McMurry family! iii Preface The goal of this research was to gain a deeper understanding of some existing cryptosystems, to implement these cryptosystems in a computer programming language of my choice, and to discover whether the composition of cryptosystems leads to greater security. The first chapter, Introduction to Cryptology, introduces several well-known cryptosystems, discusses their security, and describes how to measure the security of a cryptosystem. The second chapter, Discoveries in Cryptology, includes discoveries I have made about specific cryptosystems, compositions of cryptosystems, and the security of these compositions. In completing this work, I have discovered that: There is an easy way to generate nxn invertible matrices over Z26 which leads to a practical method of implementing Hill’s Cipher. The Affine Cipher discussed in undergraduate textbooks is a group under the operation of function composition, and the order of each Affine Cipher can be easily computed. Composition of cryptosystems can lead to either more or less security. Finally, this research has resulted in programs that allow a user to make their own cryptosystem by creating finite compositions from a set of five different cryptosystems. Through this program I have been able to analyze the security and practicality of compositional cryptology. iv Table of Contents Chapter 1: Introduction to Cryptology 1 Chapter 2: Discoveries in Cryptology 12 Appendix 28 References 31 v Chapter One: Introduction to Cryptology What is Cryptology? Krypto is a Greek word that means ‘secret’ or ‘hidden’. Therefore, cryptology is the study of encrypting and decrypting secret messages. This study can be divided into cryptography and cryptanalysis. Cryptography refers to designing cryptosystems that code and decode messages, whereas cryptanalysis is concerned with techniques used in the unauthorized decoding of messages. Cryptology is useful in transferring messages that contain sensitive material, such as military orders during wartime or personal identification information over the Internet. However, because of clever cryptanalysts and the unauthorized decoding of secret messages, development of secure cryptosystems is vital. History of Cryptology Although there is evidence of cryptology as far back as 1900 BC, detailed examples are not found until 500 BC, when Hebrew scribes recorded the book of Jeremiah using a reversed-alphabet Substitution cipher called ATBASH. The most famous early use of cryptology is Julius Caesar using a Shift cipher of three letters [Dupuis]. Known as the Caesar cipher, it is still taught in many cryptology textbooks as a special case of a Shift cipher. Classical cryptology can be defined as cryptosystems designed before the 1940s and the advent of the computer age. Classic ciphers differ from modern ciphers in that the underlying mathematics is usually much simpler. Before the development of computers, many classical ciphers were considered secure enough to use at least during some period in history. However, now computers can be programmed to carry out various attacks against classical ciphers that were before impossible. Cryptology has expanded and grown to a more complex study in an effort to develop ciphers secure enough to withstand attacks by computers. Manipulating Letters Although messages are understood through their alphabetic form, it is convenient to substitute numbers for letters to be able to manipulate and encode them. For instance, when using the English alphabet of A to Z, you can replace each letter with the numbers 0 through 25. A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Table 1 Of course, when you take into consideration using lower case, upper case, punctuation, and other symbols, more numbers are required. When messages are converted into numbers it is possible to perform a variety of mathematical operations on the numbers and then convert the numbers back into letters, hence forming a secret, unintelligible message. Uniformly Distributed Letter Cipher Many ciphers have encryption/decryption functions that allow for easier enciphering and deciphering of the message. Other ciphers, like DES (Data Encryption Standard) make use of a sequence of encryption/decryption steps. The Uniformly Distributed Letter (UDL) cipher [Lewand, p.76-79] uses the relative frequencies of English letters to create an encryption relation rather than an encryption function. For instance, the letter e has a relative frequency of approximately 0.13, meaning that in typical English texts, e appears approximately 13% of the time. The rest of the letters in the English alphabet occur in typical English texts according to varying percentages [Lewand, p. 36]. 1 Letter Relative Frequency Letter Relative Frequency A 8.167% N 6.749% B 1.492% O 7.507% C 2.782% P 1.929% D 4.253% Q 0.095% E 12.702% R 5.987% F 2.228% S 6.327% G 2.015% T 9.056% H 6.094% U 2.758% I 6.966% V 0.978% J 0.153% W 2.360% K 0.772% X 0.150% L 4.025% Y 1.974% M 2.406% Z 0.074% Table 2 Because e has a relative frequency of approximately 13%, the UDL cipher chooses 13 numbers between 00 and 99 inclusive that can be substituted for e. For example, the numbers substituted for e might come from the set, {08, 12, 20, 46, 47, 59, 64, 79, 81, 85, 90, 94, 97}. This continues until each English letter has been assigned its own set of unique number(s) between 00 and 99. The table below [Lewand, p. 78] can be used for encoding letters into numbers and decoding numbers back into letters. Letter Set of Numbers Letter Set of Numbers A 15,33,37, 55, 57, 72, 91, 96 N 06, 17, 22, 31, 49, 58 B 24 O 02, 10, 41, 51, 66, 75, 83 C 03, 39, 67 P 13,18 D 04, 43, 61, 88 Q 36 E 08, 12, 20, 46, 47, 59, 64, 79, 81, 85, 90, 94, 97 R 21, 25, 65, 68, 92, 95 F 40, 48 S 00, 28, 52, 63, 74, 78 G 29, 53 T 07, 19, 23, 35, 38, 54, 70, 84, 89 H 05, 16, 30, 42, 69, 99 U 09, 32 I 14, 45, 50, 60, 73, 82, 93 V 44 J 11 W 56, 80 K 77 X 86 L 01, 26, 71, 98 Y 62, 76 M 34, 87 Z 27 Table 3 Using Table 3 we could encrypt the word, ebenezer, to 08, 24, 12, 06, 20, 27, 46, 21. Note that each time e is encoded the next letter in the set corresponding to e is used, and when the end of the set is reached, the numbers start over again. Another method of encoding e would be to randomly choose a number from the set, {08, 12, 20, 46, 47, 59, 64, 79, 81, 85, 90, 94, 97}, with each number being equally likely to be chosen. Because many of the letters correspond to more than one number, the encryption utilizes a relation rather than a function. The UDL cipher is useful in evening out letter frequencies, which cryptanalysts sometimes use to break ciphers. In the enciphered message, each number between 00 and 99 will have approximately the same frequency and each number will have approximately the same relative frequency of 1%. 2 Substitution Cipher Like its name suggests, the Substitution cipher encodes messages by substituting each letter for a unique letter. A key for the Substitution cipher is a one-to-one correspondence between the usual English alphabet and a rearrangement or permutation of it. The key for a Substitution cipher is often expressed in table form. For example, a permutation of the usual English alphabet might be obtained by reversing the order of the alphabet (Table 4), or by using a phrase like “I LOVE MCMURRY”, with spaces and duplicate letters deleted for the first part of the key, then appending the remaining unused letters of the English alphabet in alphabetical order for the last part of the key (Table 5). A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Z Y X W V U T S R Q P O N M L K J I H G F E D C B A Table 4 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z I L O V E M C U R Y A B D F G H J K N P Q S T W X Z Table 5 Shift Cipher The simplest classical cipher is the Shift cipher.