The primes_instructor module¶
-
primes_instructor.
rsa_gen
(ndigits)¶ Generate RSA (Rivest-Shamir-Adleman) public/private key pair with ndigits digits
- Outputs:
p,q auxiliary prime numbers with ndigits digits
N encryption modulo (part of public key such that \(N=pq\))
N2 auxiliary integer such that \(N_2=(p-1)(q-1)\)
e encryption power (part of public key)
d decryption power (part of private key)
The encryption function is:
def encrypt(x): pow(x,e,N)
The decryption function is:
def decrypt(y): pow(y,e,N)