RSA Cheat SheetSetup
- n = p * q
- m = (p - 1) * (q - 1)
Choose e
- smallest number > 1 that does NOT divide m
Find d
- find d such that:
(e * d) % m = 1
Encryption
Decryption
Key Reminders
- always reduce early using % n
- break big exponents into smaller ones
- always check: (e * d) % m = 1
- decrypted message should match original