| Download
All published worksheets from http://sagenb.org
Project: sagenb.org published worksheets
Views: 168731Image: ubuntu2004
one computes n=p*q= 47 * 59 = 2773
one computes φ(n)=(p-1)(q-1)= 46 * 58 = 2668
one checks that e (= 17 ) is actually coprime with φ(n) since gcd(e,φ(n))= 1 and one computes its inverse d= e^(-1) mod φ(n).
For this, one may use the extended Euclidean algorithm, or d=1/mod(e,φ(n))= 157
Finally, the public key is Ke=(e,n)=( 17 , 2773 ). The private key is Kd=(d,n)=( 157 , 2773 ).
Encryption: one computes 66 ^ 17 mod 2773 = 872
Encryption: one computes 872 ^ 157 mod 2773 = 66
66