LearnViz Math
Expert ⛓ Discrete Math & Number Theory Topic 96 of 103

RSA Cryptography

Public-key encryption using prime factorisation difficulty.

Key idea

Public-key encryption using prime factorisation difficulty.

In depth

Choose primes p, q, set n = pq, and a public exponent e coprime to φ(n); the private exponent d satisfies ed ≡ 1 (mod φ(n)). Encrypt c = mᵉ mod n, decrypt m = cᵈ mod n. Security rests on the difficulty of factoring n.

Worked example

p = 3, q = 11, n = 33, φ = 20, e = 3, d = 7. Encrypt m = 4: 4³ = 64 ≡ 31; decrypt: 31⁷ ≡ 4 (mod 33).

Formula

c = mᵉ mod n

Real-world uses

Common mistake

Using small or poorly chosen primes.

How to learn this

  1. Read the key idea and say it in your own words.
  2. Work through the worked example, then try a similar problem.
  3. Use the interactive lesson’s visual and mini-quiz to check the pattern.

Frequently asked questions

What is RSA Cryptography?

Public-key encryption using prime factorisation difficulty. It is a topic at the expert level in Discrete Math & Number Theory.

What is the formula for RSA Cryptography?

The key formula is c = mᵉ mod n.

Where is RSA Cryptography used in real life?

Real-world examples: Protecting online banking, email and HTTPS connections with public-key encryption.

What should I learn before RSA Cryptography?

Make sure you are comfortable with Goldbach and Twin Prime Conjectures, the previous topic in Discrete Math & Number Theory.

What is a common mistake with RSA Cryptography?

Using small or poorly chosen primes.

How can I practise RSA Cryptography?

Open the interactive lesson, play with the visual, then answer the three-question mini-quiz. Getting two right marks the topic complete.

What comes after RSA Cryptography?

Move on to Diffie–Hellman Key Exchange next.

Related expert topics in Discrete Math & Number Theory