Download presentation
Presentation is loading. Please wait.
1
RSA cryptosystem with large key length
Wanjiang Qian
2
Outline RSA background RSA example Three algorithms
Totient function φ(n) RSA algorithm RSA example Three algorithms Miller-Rabin primality test algorithm Euclidean algorithm Modular exponentiation
3
RSA Two Keys Idea Requirements Private key known only to individual;
Public key available to anyone. Idea Confidentiality: encipher using public key, decipher using private key; Integrity/authentication: encipher using private key, decipher using public key. Requirements It must be computationally easy to encipher or decipher a message given the appropriate key; It must be computationally infeasible to derive the private key from the public key; It must be computationally infeasible to determine the private key from a chosen plaintext attack.
4
RSA background Totient function φ(n) Algorithm
Number of positive integers less than n and relatively prime to n. Relatively prime means with no factors in common with n. Example: φ(10) = 4 1, 3, 7, 9 are relatively prime to 10. Algorithm Choose two large prime numbers p, q Let n = pq; then φ(n) = (p–1)(q–1) Choose e < n such that e is relatively prime to φ(n). Compute d such that ed mod φ(n) = 1 Public key: (e, n); private key: (d, n) Encipher: c = me mod n Decipher: m = cd mod n
5
Rsa example (Confidentiality)
Take p = 7, q = 11, so n = 77 and φ(n) = 60 Alice chooses e = 17, making d = 53 Bob wants to send Alice secret message HELLO ( ) 0717 mod 77 = 28 0417 mod 77 = 16 1117 mod 77 = 44 1417 mod 77 = 42 Bob sends , Alice receives Alice uses private key, d = 53, to decrypt message. No one else could read it, as only Alice knows her private key and that is needed for decryption
6
1. Miller Rabin algorithm
Miller-Rabin Primality test an algorithm to determine whether the number is prime or not. Input: n is the number needs to have primality test, k is the number of witnesses used to test primality of n. O(n + min{n-4, k}*n + min{n-4,k}*J + min{n-4,k}*n*J) O(n + k*n + k*J + k*n*J)
7
2. Euclidean algorithm Euclidean algorithm
an efficient way to calculate the greatest common divisor of two numbers. Defined notation ak and bk, k is the steps the Euclidean algorithm will take For one step, b1=0, two steps, b2>=1 For more steps, ak=bk+1, ak-1=bk bk-1=ak mod bk => ak=q*bk+bk-1 => bk+1=q*bk+bk-1 Since q>=1, bk+1>=bk+bk-1 Let Fib(n) stands for nth Fibonacci number. Fib(n) = Fib (n-1) + Fib (n-2) > 2 Fib (n-2) > 2*(2* Fib (n-4)) > 2*(2*(2* Fib (n-6))) In general, Fib(n)>2k Fib(n-2k), Let n-2k=1 Fib (n) > 2(n-1)/2 Fib(1) = 2(n-1)/2 Fib (n+1) = a+b, a+b > 2(n+1-1)/2 and n < 2log(a+b) O(log(a + b)) Input: a, b not both zero Euclidean(a, b) if b=0 return a endif Euclidean(b, a%b) endEuclidean
8
3. Modular exponentiation
a type of exponentiation performed over a modulus. compute md mod n. Input integer d is expressed as a binary number dkdk-1…d0. Using dynamic programming, it will look up the previous result form the table. Time complexity will be O(2*k). k is the length of binary number d.
9
Experimentation Key length Number of attempts (Primality test)
Time cost (sec) Average Time cost (sec) 200 37 1000 52 2000 276 3000 742 4000 2399 5000 870 6000 1333
10
References: [1] Diffie, W., and Hellman, M. “New directions in cryptography”, IEEE Trans. Inform. Theory IT-22, pp , 1976 [2] G.N. Shinde, and H.S. Fadewar, “Faster RSA Algorithm for Decryption Using Chinese Remainder Theorem”, ICCES, vol.5, no.4, pp , 2008 [3] H. W. Lenstra, Jr., “Miller’s primality test”, Inform. Process. Lett. 8:2, pp , 1979. [4] L. Zhong, “Modular exponentiation algorithm analysis for energy consumption and performance,” tech. rep., Citeseer,2000. [5] Nentawe Y. Goshwe, “Data Encryption and Decryption Using RSA Algorithm in a Network Environment”, International Journal of Computer Science and Network Security, Vol.13 No.7, pp. 9-13, 2013 [6] R.L. Rivest, A. Shamir, and L. Adleman, “A Method for Obtaining Digital Signatures and Public-Key Cryptosystems”, Communications of the ACM, Volume21 Issue 2, pp , 1978. [7] Rene Schoof, “Four primality testing algorithms”, Algorithmic Number Theory, Volume 44, 2008.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.