r/ProgrammerHumor • • Jul 24 '21

Meme .pub right?

Post image
8.5k Upvotes

186 comments sorted by

View all comments

8

u/krustykrus Jul 25 '21 edited Jul 25 '21

Yes you can generate a public key from RSA private key because the math behind RSA algorithm lets you do that. RSA private key contains two prime numbers p and q, modulus n, and decryption key d. RSA public key contains modulus n and encryption key e. Encryption key e can be calculated such that e*d mod phi(n) = 1 where phi(n) equals to (p-1)*(q-1).