A Study of Factoring Algorithms Related to the RSA Cryptosystems
Total Page:16
File Type:pdf, Size:1020Kb
A study of Factoring Algorithms related to the RSA Cryptosystems by NORLIZA BINTI MOHAMED Dissertation submitted in partial fulfillment of the requirements for the degree of Master of Science (Mathematics) May 2008 ACKNOWLEDGEMENT All praise to Allah, for his blessing and his grace to me gain enough strength to complete this dissertation. All difficulty can be overcomes with calm. Also prayer and regards for our prophet Muhammad S.A.W. with great reverence. My appreciation and high regard aimed specifically to Dr. Hailiza Binti Kamarul Haili who has supervised me to complete this dissertation. All sacrifice and her noble effort, only God is able to return it. My appreciation also goes to all School of Mathematical Sciences lecturers, Universiti Sains Malaysia, who had taught me during this course. Much affection to my beloved husband (Mohd Khir bin Ahmad) and mother (Merak Mas Binti Zakaria) who have given their sincere love, attention, support and understanding that have helped me get through good and rough times to me. I would like to express my deepest love and appreciation to my beloved children (Muhammad Nasrullah, Nur Karmila, Nur Dalila, Nur Qistina and Ahmad Zubair) for their endless love. Finally, to all involved, your sacrifice and assistance shall be remembered forever. What is good come from Allah S.W.T. and weaknesses are all mine. Wallahua'alarn. Thank you very much. 11 CONTENTS Acknowledgement. .............................................................................. .ii Contents ........................................................................................... .iii List of tables ....................................................................................... v Abstrak ............................................................................................. vi Abstract .............................................................................................vii CONTENTS CHAPTER 1 : INTRODUCTION 1.1 Introduction .................................................................. 1 1.2 Objectives .................................................................... 3 1.3 Dissertation outline ......................................................... 3 CHAPTER 2 : LITERATURE REVIEW ON RSA CRYPTOSYSTEMS 2.1 Introduction .................................................................. 5 2.2 History ........................................................................ 6 2.3 RSA Cryptosystem ......................................................... 8 2.4 Implementation ofRSA ................................................... 10 2.5 The RSA Algorithm ........................................................ 12 CHAPTER 3 : PRIMALITY TEST 3.1 Naive methods .............................................................. 20 3.2 Probabilistic tests.......................................................... 21 111 3.3 Miller-Robin methods ..................................................... 22 3.3.1 Mathematica Function for the Primality Test. ................... 25 3.4 Fermat Test .................................................................. 26 CHAPTER 4: FACTORING ALGORITHMS 4.1 Integer Factorization ....................................................... 29 4.2 The Pollard p- 1 Factoring Algorithm .................................. 30 4.2.1 Pseudocode: Pollard p-1 Factorization ......................... 32 4.3 The Pollard Rho Algorithm ............................................... 32 4.3.1 Pseudocode: Pollard Rho Factorization .......................... 35 4.4 The Pollard p -1 and Pollard's Rho Findings ........................... 36 4.5 Number Field Sieve ........................................................ 40 4.5.1 General Number Field Sieve .................................... 43 4.5.2 Special Number Field Sieve.................................... 47 CHAPTER 5 : GENERAL NUMBER FIELD SIEVE IN RSA 5.1 Factorization Record using GNFS ....................................... 50 5.2 RSA Number (Factoring Challenge) .................................... 51 5.3 Attacks on RSA............................................................ 53 5.3.1 Cracking the RSA encryption system ........................... 54 CHAPTER 6 : CONCLUSION AND SUGGESTIONS FOR FURTHER WORKS 6.1 Conclusion . 55 6.2 Suggestions for further work............................................ 56 References Attachment lV List of Tables Page Table 4.4.1 : The Pollard p- 1 Methods 38 Table 4.4.2 : The Pollard's Rho Methods 39 Table 4.5.2.1 :Factoring Using the Special Number Field Sieve 41 Table 4.5.1.2 :Factoring Using the General Number Field Sieve 42 Table 4.5.1.1 : Shows the summarizes the possibilities divisibility Scenarios 45 Table 5.2.1 :The table shows the recorded RSA Numbers factored with the 52 algorithm used. v Abstrak SATU KAJIAN TENTANG ALGORITMA PEMFAKTORAN DAN PERKAITANNYA DALAM RSA KRIPTOSISTEM Kriptografi adalah merujuk kepada satu kajian mengenai cara menghantar mesej/ maklumat secara rahsia di mana hanya penerima maklumat tersebut sahaja yang dapat membaca maklumat yang disampaikan. Dalam tahun 1977, Ronal Rivest, Adi Shamir dan Leonard Adleman dengan menggunakan nama keluarga masing-masing RSA telah mencipta satu teknologi baru dalam dunia Kriptografi yang dipanggil RSA Kriptosistem. Sistem ini adalah kriptosistem 'public-key' yang mana telah memperkenalkan kedua-dua kunci 'encrypt' dan 'decrypt'. Keberkesanan RSA Kriptosistem bergantung kepada nombor perdana yang di gunakan dan juga kepada algoritma pemfaktoran integer yang efektif. Di dalam tesis ini kita membincangkan beberapa algoritma pemfaktoran dan juga pengujian nombor perdana yang berkaitan dengan kriptosistem RSA. Beberapa contoh juga ada di tunjukkan untlik menampilkan konsep matematik yang di gunakan. Kita juga telah menggunakan programming MATHEMA TICA untuk membantu memahami pengujian nombor perdana dan juga pemfaktoran nombor komposit kepada nombor nombor perdana. Beberapa penemuan oleh para penyelidik didalam pemfaktoran integer ada di tunjukkan dan dibincangkan. Kemungkinan di masa yang akan datang, kita akan menjumpai satu algoritma yang lebih efisien dalam pemfaktoran integer yang besar. InsyaAllah. Vl Abstract Cryptography is referred to the study of methods for sending messages in secret so that the intended recipient can remove the disguise and read the message. Now, this cryptography is extremely useful. In 1977, Ronald Rivest, Adi Shamir and Leonard Adleman with the initial of their surnames RSA were publicly a RSA Cryptosystem. This RSA Cryptosystem is a public-key cryptosystem that offers both encryption and digital signatures which is more secure. RSA cryptosystem relies very much on the length of the prime numbers used as well as the effectiveness of the available integer factoring algorithms. In this thesis several factoring algorithms and primality tests related to the RSA cryptosystem are discussed. Some examples are given as to indicate the underlying mathematical concepts used m the process. A mild programmmg usmg MATHEMATICA were also carried out for primality test and factoring composite numbers into primes. Some challenges and results on the latest development in integer factorization are shown and discussed. It is possible that new factoring algorithms may be developed in the future which once again targeted primes with certain properties. Vll CHAPTERl INTRODUCTION 1.1 Introduction A study of cryptography is a study of the science of writing in secret code which is an ancient art. In 1977, Ron Rivest, Adi Shamir and Leonard Adleman proposed a public key cryptosystem that uses only elementary ideas from number theory (Johannes, 2000). Shortly after that they developed a cryptosystem that was the first real public-key cryptosystem capable of encryption and digital signatures. Their enciphering system is called RSA, after the initials of the algorithm's inventors. Its security depends on the assumption that in the current state of computer technology, the factorization of composite with large prime factors is prohibitively time-consuming. The RSA algorithm has become the foundation of an entire generation of public key cryptography security products because it provides secure communications over distances between parties that have not previously met. Indeed, RSA has provided the ideal mechanism required for private communications over electronic networks. It forms the basis of almost all of the security products currently in use on the Internet for financial and other private communications, including most organizational level Public Key Infrastructure systems. RSA uses a variable size encryption block and a variable size key. The key-pair is derived from a very large number, n, that is the product of two prime numbers chosen according to special rules. These primes may be 100 or more digits in length each, yielding an n with roughly twice as many digits as the prime factors. The public key information 1 includes n and a derivative of one of the factors of n; an attacker cannot determine the prime factors of n (and, therefore, the private key) from this information alone and that is what makes the RSA algorithm so secure. The ability for computers to factor large numbers, and therefore attack schemes such as RSA, is rapidly improving. The systems today can even find the prime factors of numbers with more than 200 digits. Nevertheless, if a large number is created from two prime factors that are roughly of the same size, there is no known factorization algorithm that will solve the problem in a reasonable amount