RSA Reloaded

  1. pick two large (n-bit) random prime p and q.
  2. public key is (N,e) where N=pq and e is a (2n-bit) number relatively prime to (p-1)(q-1).

    A common choice is e =3 because it permits fast encoding.

  3. secret key is d, the inverse of e modulo (p-1)(q-1), computed using the extended euclid algorithm.

 

Instances:

public key p q N (p-1)(q-1) private key raw msg encoded received decoded it out
(n=3233,e=17) 61 53 3233 3120 (n=3233,d=2753) 13 47 (13 **17 % 3233) 13 (47 ** 2753 % 3233)
(n=55,e=3) 5 11 55 40 (n=55,d=27) 13 52 (13 **3 % 55) 13 (52 **27 % 55)

 

 

 

 

References:

RSA WIKI

openssl rsa

posted on 2012-02-18 20:25  grepp  阅读(143)  评论(0编辑  收藏  举报

导航