๐Ÿ”‘ RSA Key Exchange

๐Ÿ‡บ๐Ÿ‡ฆ UK โ† Back
Getting started
Choose two distinct prime numbers p and q above, then click Compute Keys.
RSA security rests on the difficulty of factoring the product of two large primes. Here we use small primes so every step remains transparent.

๐Ÿ”’ RSA Key Exchange โ€” Public-Key Cryptography

Step through the RSA algorithm: choose two primes, compute n and ฯ†(n), find public exponent e and private exponent d, then encrypt and decrypt a message with the resulting keypair.

๐Ÿ”ฌ What It Demonstrates

RSA security relies on the difficulty of factoring large numbers. Given n = pยทq, computing ฯ†(n) = (pโˆ’1)(qโˆ’1) is easy if p and q are known, but practically impossible if only n is given. The extended Euclidean algorithm computes d = eโปยน mod ฯ†(n).

๐ŸŽฎ How to Use

Choose two primes p and q. The system computes n, ฯ†(n), public key e, and private key d. Enter a message to encrypt with the public key and decrypt with the private key. See each modular exponentiation step.

๐Ÿ’ก Did You Know?

RSA was published in 1977 by Rivest, Shamir and Adleman. The same algorithm was independently discovered in 1973 by Clifford Cocks at GCHQ but remained classified until 1997. Modern RSA uses 2048+ bit keys.