Notifications
Clear all
Topic starter 04/08/2025 11:49 pm
RSA (Rivest–Shamir–Adleman) is one of the most widely used encryption algorithms in computer security. It’s the backbone of many secure systems, including HTTPS, VPNs, and digital signatures.
🧩 What RSA Is
RSA is a type of asymmetric cryptography, which means it uses two keys:
- A public key to encrypt data
- A private key to decrypt it
This setup allows secure communication even over insecure networks—because only the private key holder can read the message.
🛠️ How RSA Works
-
Key Generation:
- Choose two large prime numbers, multiply them to get
n
- Calculate a value called the Euler’s totient of
n
- Pick an encryption exponent
e
that’s coprime with the totient - Compute the decryption exponent
d
such that(d × e) mod totient = 1
- Public key =
(n, e)
, Private key =(n, d)
- Choose two large prime numbers, multiply them to get
-
Encryption:
- Convert the message into a number
M
- Encrypt using:
C = M^e mod n
- Convert the message into a number
-
Decryption:
- Decrypt using:
M = C^d mod n
- Decrypt using:
🔒 Why RSA Is Secure
Its security relies on the difficulty of factoring large numbers. While multiplying two primes is easy, reversing the process (factoring) is computationally hard—especially with keys that are 2048 bits or longer.
🧠 Real-World Use
- Digital signatures: Verifying authenticity of documents
- Secure web browsing: HTTPS uses RSA during the handshake
- Email encryption: Tools like PGP rely on RSA
Imagine RSA as a locked mailbox:
- Anyone can drop a message in (using the public key)
- Only the owner with the private key can open it