Interactive Educational Tool for Understanding Public-Key Cryptography
RSA (Rivest-Shamir-Adleman) is a public-key cryptosystem widely used for secure data transmission. It relies on the mathematical difficulty of factoring large composite numbers.
Prime numbers are the foundation of RSA security. The algorithm uses two large primes to create keys that are computationally infeasible to break without knowing the original primes.
Choose two distinct prime numbers. In real RSA, these are typically 1024-4096 bits long.
Multiply the two primes together to get n, which is part of both public and private keys.
Calculate Euler's totient function, which counts numbers less than n that are coprime to n.
Select e such that 1 < e < ฯ(n) and gcd(e, ฯ(n)) = 1. Common choice: e = 65537.
Calculate d as the modular multiplicative inverse of e modulo ฯ(n).
Public Key: (e, n) - Share this freely for encryption
Private Key: (d, n) - Keep this secret for decryption