next up previous contents
Next: Sending Nikita an Encrypted Up: How RSA works Previous: One-way Functions   Contents

How Nikita Makes an RSA Public Key

Here is how Nikita makes a one-way function $ E$:
  1. Nikita picks two large primes $ p$ and $ q$, and lets $ n=pq$.
  2. It is easy for Nikita to then compute

    $\displaystyle \varphi (n) = \varphi (p)\cdot \varphi (q) = (p-1)\cdot (q-1).
$

  3. Nikita next chooses a ``random'' integer $ e$ with

    $\displaystyle 1<e<\varphi (n)$ and $\displaystyle \gcd(e,\varphi (n))=1.
$

  4. Finally, Nikita uses the algorithm from Lecture 7 to find a solution $ d$ to the equation

    $\displaystyle ex \equiv 1\pmod{\varphi (n)}.
$



The Encoding Function:
Nikita defines a function $ E:\mathbb{Z}/n\mathbb{Z}\rightarrow \mathbb{Z}/n\mathbb{Z}$

$\displaystyle E(x) = x^e.
$

(Recall that $ \mathbb{Z}/n\mathbb{Z}= \{0,1,\ldots,n-1\}$ with addition and multiplication modulo $ n$.) Then anybody can compute $ E$ fairly quickly using the repeated-squaring algorithm from Lecture 7.

Nikita's public key is the pair of integers $ (n,e)$, which is just enough information for people to easily compute $ E$. Nikita knows a number $ d$ such that $ ed\equiv 1\pmod{\varphi (n)}$, so, as we will see below, she can quickly compute $ E^{-1}$.

Now Michael or even The Collective can send Nikita a message whenever they want, even if Nikita is asleep. They look up how to compute $ E$ and compute $ E($their message$ )$.


next up previous contents
Next: Sending Nikita an Encrypted Up: How RSA works Previous: One-way Functions   Contents
William A Stein 2001-10-01