Math 2.0

example

RSA cryptosystem

Example

The RSA cryptosystem is an example of public-key cryptography. To make the keys, choose two distinct primes pp and qq, and put n=pqn = pq and φ(n)=(p−1)(q−1)\varphi(n) = (p - 1)(q - 1), the value of Euler's totient function. Choose an integer ee with 1<e<φ(n)1 < e < \varphi(n) and gcd⁡(e,φ(n))=1\gcd(e, \varphi(n)) = 1. Let dd be the inverse of ee modulo φ(n)\varphi(n). The public key is (n,e)(n, e), and the private key is dd. To encrypt a message mm with 0≤m<n0 \le m < n, compute c=me mod nc = m^e \bmod n. To decrypt, compute cd mod nc^d \bmod n, which is equal to mm. A small case: p=5p = 5, q=11q = 11, n=55n = 55, φ(n)=40\varphi(n) = 40, e=3e = 3 and d=27d = 27, since 3⋅27=81≡1(mod40)3 \cdot 27 = 81 \equiv 1 \pmod{40}. The message m=2m = 2 gives c=23=8c = 2^3 = 8, and 827≡2(mod55)8^{27} \equiv 2 \pmod{55}.

Remarks

Decryption works by Euler's theorem: ed=1+kφ(n)ed = 1 + k \varphi(n), so med≡m(modn)m^{ed} \equiv m \pmod n when gcd⁡(m,n)=1\gcd(m, n) = 1. The general case follows from the Chinese remainder theorem. The security rests on the belief that it is hard to factor nn when pp and qq are large. Ron Rivest, Adi Shamir and Leonard Adleman described the system publicly in 1977.

Explanations

L1 human

Anyone can raise a message to the power ee modulo nn. To undo this, you need dd, and to find dd you need the factors of nn. Multiplying two large primes is easy, but recovering them from the product is believed to be very hard.

What this node needs for W3
  • a person confirmed each agent-written section: rule P04 (0 of 1)

The writing levels say how complete the text of a node is. They do not measure its truth.

What this needs

To read this node, read these 9 nodes in this order. The foundations come first, and the list ends with this node.

Each node uses the nodes above it. The colour of the bar on a box shows the evidence level, and the box also gives it as text. The list below has the same nodes.
  • no evidence level
  1. Divisibility definition
  2. Modular exponentiation concept
  3. Congruence modulo n definition
  4. Greatest common divisor definition
  5. Modular multiplicative inverse definition
  6. Coprime integers definition
  7. Euler's totient function definition
  8. Euler's theorem statement
  9. RSA cryptosystem example

Sources

  1. Web https://en.wikipedia.org/wiki/RSA_cryptosystem, Key generation
  2. Web https://en.wikipedia.org/wiki/RSA_cryptosystem, Proof using Euler's theorem