math security RSA (Rivest–Shamir–Adleman) is a public-key cryptosystem widely used for secure data transmission. Its security relies on the practical difficulty of factoring the product of two large prime numbers.
The Setup (Key Generation)
- Select Primes: Choose two distinct large prime numbers and .
- Modulus: Compute .
- is used as the modulus for both public and private keys.
- Totient: Compute .
- Public Exponent: Choose an integer such that and .
- Common choice: .
- Private Exponent: Determine as the modular multiplicative inverse of modulo .
- Use the Pulverizer (Divisibility and GCD) to find .
Keys:
- Public Key: (Given to everyone).
- Private Key: (Kept secret, along with ).
Encryption & Decryption
Let be the message (converted to an integer ).
Encryption: Sender uses the recipient’s Public Key.
Decryption: Recipient uses their Private Key.
Why It Works (Correctness)
We need to prove that . By Euler’s Theorem (Modular Arithmetic), .
- Note: The security rests on the fact that if you only know , finding is equivalent to factoring into and . There is no known efficient algorithm for this on classical computers.