Randomization of RSA and Other Main Public-Key Cryptosystems
Total Page:16
File Type:pdf, Size:1020Kb
Masaryk University Faculty of Informatics Randomization of RSA and other main public-key cryptosystems Master’s Thesis Kuldeep Goyal Pune, Autumn 2018 Declaration Hereby I declare that this thesis is my original authorial work, which I have worked out on my own. All sources, references, and literature used or excerpted during elaboration of this work are properly cited and listed in complete reference to the due source. Kuldeep Goyal Advisor: prof. RNDr. Jozef Gruska, DrSc. Acknowledgements I am thankful to Dr. K Ramachandaran and Ms. Arunima Gupta for giving me the opportunity to study at Masaryk University. Many many thanks to Ram Singh, Bhupendra Singh, Gajraj Kuldeep, M Arvind Rao and friends for their support during my stay at Brno, Czech Republic. I would like to thank prof. RNDr. Jozef Gruska, DrSc. for all the help, guidance and useful comments, which enabled me in completing this work and enriched me with additional knowledge. I am also thankful to Dr. Dhananjoy Dey for his valuable sugges- tions and help for this work. I am thankful to all the faculty and staff members of Masaryk Uni- versity especially prof. RNDr. Václav Matyáš and Ing. Radka Brolíková for their support and guidance during the master degree. Last but not least, I thank my friends, my parents, and brothers for their patience and support during my studies. i Abstract Public-key cryptosystems (PKC) are not perfectly secure cryptosys- tems. Many theoretical and practical attacks are possible on PKCs. RSA and many other main PKCs are prone to computational indis- tinguishability and other properties required for cryptosystems to be semantically as well as perfectly secure. Randomization of the en- cryption process is popular for avoiding these attacks and making cryptosystem perfectly secure. This thesis aims to present the ran- domization of RSA and other main PKCs, and the implementation of two well-known randomizations of PKCs. This thesis also contains the details of computational problems upon which the security of various PKCs is based. This thesis also presents evaluation approaches for evaluating PKCs and one of the applications of randomization of PKCs. ii Keywords Cryptosystem, Computational Indistinguishability, Perfect Security, Probabilistic Algorithm, Pseudorandom Numbers, Public-key Cryp- tosystems, Quantum Cryptography, Randomized Algorithm, Seman- tic Security, Trapdoor Function. iii Contents 1 Introduction 1 2 Basics of discrete mathematics and computational complex- ity. 3 2.1 One-way trapdoor functions .................3 2.2 Unapproximable trapdoor predicates .............3 2.3 Stretch function ........................3 2.4 Hard-core predicate ......................4 2.5 Computationally infeasible problems .............4 2.6 Quadratic residue .......................5 2.7 Decision problems for groups .................5 2.8 Blum primes and integers ...................6 2.9 Negligible function ......................6 2.10 Computational indistinguishability .............6 2.11 Key theorems .........................7 2.11.1 Euler’s totient theorem . .7 2.11.2 Fermat’s little theorem . .7 3 Public key cryptosystems (PKC) 9 3.1 History of Public Key Cryptosystems .............9 3.2 Formal view of PKC ...................... 10 3.3 RSA cryptosystem ....................... 11 3.3.1 Design of RSA cryptosystem . 11 3.3.2 Proof of the correctness of RSA . 11 3.4 Rabin cryptosystem ...................... 12 4 Randomized algorithms and encryptions 13 4.1 Tools for randomization .................... 15 4.1.1 Hash functions . 15 4.1.2 Cryptographically strong pseudorandom gen- erators (CSPRG) . 16 4.1.3 Blum Blum Shub pseudorandom generator (BBS- PRG) . 16 4.2 Randomized encryption(RE) ................. 17 4.2.1 Semantic security of encryption . 17 4.2.2 Perfectly secure cryptosystems . 17 v 4.2.3 Need of randomized encryption(RE) . 18 4.2.4 Formal scheme of randomized encryption(RE) . 18 4.3 Randomized PKCs (RPKC) ................. 19 4.3.1 McEliece public-key cryptosystem . 19 4.3.2 ElGamal cryptosystem . 20 4.3.3 Randomized version of RSA cryptosystem . 22 4.4 Probabilistic PKCs (PPKC) ................. 23 4.4.1 Goldwasser-Micali PPKC . 24 4.4.2 Blum-Goldwasser PPKC . 25 4.4.3 RSA based probabilistic public-key encryption system . 25 4.5 Recent versions of PKCs with randomization ........ 27 5 Implementation, comparison, evaluation, and applications 29 5.1 Implementation ........................ 29 5.1.1 McEliece PKC . 29 5.1.2 RSA-OAEP and RSA-PSS from PKCS#1 . 30 5.2 Comparative analysis of randomized PKCs .......... 32 5.2.1 Public-key cryptosystems and related computa- tional problems . 32 5.2.2 Evaluation approaches . 33 5.2.3 Performance evaluation of implemented McEliece PKC and RSA-OAEP . 35 5.3 Application of randomized PKC ............... 40 5.3.1 Post-quantum pretty good privacy (PQP) . 40 6 Conclusion 43 References 48 vi List of Tables 5.1 Public-key cryptosystems and related computational problems upon which their security is based [5] 33 5.2 Encryption and decryption timing results for McEliece PKC in python. 35 5.3 Encryption and decryption timing results for RSA-OAEP in python. 37 vii List of Figures 5.1 Performance diagram of encryption and decryption time using McEliece PKC in python 36 5.2 Performance diagram of encryption time versus decryption time using McEliece PKC in python 36 5.3 Performance diagram of encryption and decryption time using RSA-OAEP in python 37 5.4 Performance diagram of encryption time versus decryption time using RSA-OAEP PKC in python 38 5.5 Performance diagram of encryption time using McEliece PKC versus RSA-OAEP in python 39 5.6 Performance diagram of decryption time using McEliece PKC versus RSA-OAEP in python 39 5.7 libPQP: Processing at sender side [37] 41 5.8 libPQP: Processing at receiver side [37] 42 ix 1 Introduction Cryptography made possible to communicate securely. Secret-key cryptosystems allow secure communication among different parties, but the secret-key was required to be transmitted or shared before the start of actual communication. Public-key cryptography made it more secure by solving the problem of sharing the secret-key among the parties. Public-key cryptosystem uses two keys, i.e., public key and private key where the public key is made public and the private key is kept secret. As per Kerckhoffs’s principle, cryptosystem should be secure even if everything about the system, except the key, is publicly known. The security of the encrypted text should depends solely on the security of the secret encryption key. However, the unique mapping between plaintext and ciphertext with these conditions raises a security concern as each time a plaintext is encrypted to the same ciphertext which may not be suitable if the attacker guesses the plaintext and verify by encrypting it against the given ciphertext. Therefore computational indistinguishability is essential for security. Randomization of the encryption process is the only solution to overcome this problem, in which, each time encryption process results into different output ci- phertext. The main aim is to achieve the perfectly secure cryptosystems with perfect forward secrecy, perfect backward secrecy, and semantic security. There are tools and algorithms available in the literature for ran- domization such as hashing and cryptographically strong pseudoran- dom generators. In this work, we also studied classical as well as the recently designed randomized version of RSA and other PKCs. The thesis also provides evaluation approaches for PKCs described in the literature as well as recently used. An application of McEliece PKC, i.e., post-quantum pretty good privacy (PQP), is also provided which is used to provide privacy and authentication for data communication in the post-quantum computing scenario. The thesis is organized as follows. In chapter 2, some basics of discrete mathematics and computational complexity are recalled. The- oretical need, history, and formal view of the public-key cryptosystems along with the two of the classical PKCs are presented in chapter 3. 1 1. Introduction Randomization, need of randomization of PKCs, tools of random- ization, and randomization of PKCs especially of the family of RSA are discussed in chapter 4. In chapter 5, discussion about the imple- mentation, comparison, evaluation approaches, and application of randomized PKC are given. Finally, a conclusion is provided in chapter 6. 2 2 Basics of discrete mathematics and computa- tional complexity. "The things I want to show are mechanical. Machines have less problems" —Andy Warhol (1927–1987) American Artist In this chapter, we present some basic concepts of discrete mathe- matics [1] which are used in cryptography. Most of the cryptosystems are based on infeasibility of either computation of square roots or discrete logarithm problems. Now we will discuss the concepts in the following sections. 2.1 One-way trapdoor functions A function f: X ! Y is said to be trapdoor one-way function if ∙ Function f can be computed efficiently ∙ It is not feasible to determine a polynomial time algorithm to compute the inverse of f even if full knowledge of algorithm to compute f is known ∙ The inverse of f can be efficiently computed if some special knowledge (trapdoor) is available 2.2 Unapproximable trapdoor predicates It is a predicate where anyone can select an x such that B (x) = 0 or a y such that B (y) = 1, but only those can compute B (z) for a given z, who have the trapdoor information [2]. 2.3 Stretch function I(n) : N ! N such that 8n; I(n) > n. 3 2. Basics of discrete mathematics and computational complexity. 2.4 Hard-core predicate A predicate b is said to be a hard-core predicate of a function f if it is easy to evaluate b, but it is hard to compute or even predict bx from f (x), i.e., for a given f (x), if x is uniformly chosen then it is infeasible to predict b(x) substantially better than with probability of one half (1/2) [3].