RSA Encryption & Decryption Math
Apply modular exponentiation to encrypt and decrypt a message.
Welcome
With RSA keys generated, we now apply them. Encryption and decryption are both modular exponentiations — simple to compute, infeasible to reverse without the private key.
Textbook RSA Encryption
Encrypt message M (as integer) with public key (e, n):
C = M^e mod n
Example: M=42, e=17, n=3233
C = 42^17 mod 3233
Python: C = pow(42, 17, 3233) = 2557
All lessons in this course
- Public-Key Cryptography Concepts
- RSA Key Generation Step by Step
- RSA Encryption & Decryption Math
- RSA Real-World Use Cases & Key Sizes