In a Nutshell

Secure communication on the internet relies on one fundamental idea: some math problems are easy to solve in one direction, but nearly impossible to solve in reverse. This article explores the modular arithmetic behind RSA, the geometric complexity of Elliptic Curve Cryptography (ECC), and how Diffie-Hellman allows two strangers to share a secret over an insecure channel.

1. RSA: The Power of Primes

RSA (Rivest-Shamir-Adleman) is based on the difficulty of Integer Factorization. It is easy to multiply two large prime numbers $p$ and $q$ to get $N$. It is extremely hard for a computer to take $N$ and find $p$ and $q$ if they are hundreds of digits long.

However, RSA is vulnerable if implemented without Padding. Simple RSA (textbook RSA) is deterministic, meaning the same message always produces the same ciphertext. Modern implementations use OAEP (Optimal Asymmetric Encryption Padding) to add randomness.

RSA Public-Key Exchange

Alice (Client)

Wants to send a secret
Waiting for Public Key...
Step 0: Idle

Click Next Step to begin the RSA exchange process.

Bob (Server)

Receiving the secret
Waiting to generate keys...

2. Elliptic Curve Cryptography (ECC)

ECC is the modern replacement for RSA. Instead of using large numbers, it uses the geometry of an algebraic curve over a finite field.

Because the math of ECC is much more complex for a computer to "reverse engineer," we can use much smaller keys. A 256-bit ECC key provides the same security as a 3072-bit RSA key.

There are two primary families of curves used in infrastructure today:

  • Weierstra├ƒ Curves (NIST P-256): The standard for decades.
  • Montgomery/Edwards Curves (Curve25519/Ed25519): Used in modern protocols like WireGuard and SSH.

3. Diffie-Hellman Key Exchange

How do you and a website agree on a password without an eavesdropper seeing it?

  1. You both agree on a public number (the Generator).
  2. You both pick a secret number.
  3. You mix your secret with the public number and send the result to the other person.
  4. Even if an attacker sees the "mix," they cannot un-mix it to find your secrets.
Share Article

Technical Standards & References

Rivest, R., Shamir, A., Adleman, L. (1978)
RSA Algorithm: A Public-Key Cryptosystem
VIEW OFFICIAL SOURCE
NIST SP 800-186 (2023)
Elliptic Curve Cryptography: Standards and Applications
VIEW OFFICIAL SOURCE
Koblitz, N. (1987)
ECC: Elliptic Curve Cryptosystems
VIEW OFFICIAL SOURCE
NIST (2024)
Post-Quantum Cryptography: NIST PQC Standards
VIEW OFFICIAL SOURCE
Mathematical models derived from standard engineering protocols. Not for human safety critical systems without redundant validation.