notesonly.in

One notebook for every subject — open it anywhere.

Log in

Cryptography basics (RSA, Diffie-Hellman)

General · Mathematics

Study notes

Q: Tiny RSA: p = 5, q = 11. Encrypt m = 9 with e = 3. n = 55, φ(n) = 4×10 = 40. e = 3 (gcd(3,40) = 1 ✓). c = 9³ mod 55 = 729 mod 55: 729 = 13×55+14. c = 14. Decrypt: d with 3d ≡ 1 mod 40: d = 27 (81 = 2×40+1 ✓). m = 14^27 mod 55 = 9 ✓ (Euler's theorem at work!).

← Back to topics for Mathematics