![Choose two distinct prime numbers p and q.
For security purposes, the integers p and q should be chosen at random, and should be of similar bit-length. Prime integers can be efficiently found using a primality test.
Compute n = pq.
n is used as the modulus for both the public and private keys. Its length, usually expressed in bits, is the key length.
Compute ?(n) = ?(p)?(q) = (p ? 1)(q ? 1) = n - (p + q -1), where ? is Euler's totient function.
Choose an integer e such that 1 < e < ?(n) and gcd(e, ?(n)) = 1; i.e., e and ?(n) are coprime.
e is released as the public key exponent.
e having a short bit-length and small Hamming weight results in more efficient encryption – most commonly 216 + 1 = 65,537. However, much smaller values of e (such as 3) have been shown to be less secure in some settings.[5]
Determine d as d ? e?1 (mod ?(n)); i.e., d is the multiplicative inverse of e (modulo ?(n)).
This is more clearly stated as: solve for d given d?e ? 1 (mod ?(n))
This is often computed using the extended Euclidean algorithm. Using the pseudocode in the Modular integers section, inputs a and n correspond to e and ?(n), respectively.
d is kept as the private key exponent. Choose two distinct prime numbers p and q.
For security purposes, the integers p and q should be chosen at random, and should be of similar bit-length. Prime integers can be efficiently found using a primality test.
Compute n = pq.
n is used as the modulus for both the public and private keys. Its length, usually expressed in bits, is the key length.
Compute ?(n) = ?(p)?(q) = (p ? 1)(q ? 1) = n - (p + q -1), where ? is Euler's totient function.
Choose an integer e such that 1 < e < ?(n) and gcd(e, ?(n)) = 1; i.e., e and ?(n) are coprime.
e is released as the public key exponent.
e having a short bit-length and small Hamming weight results in more efficient encryption – most commonly 216 + 1 = 65,537. However, much smaller values of e (such as 3) have been shown to be less secure in some settings.[5]
Determine d as d ? e?1 (mod ?(n)); i.e., d is the multiplicative inverse of e (modulo ?(n)).
This is more clearly stated as: solve for d given d?e ? 1 (mod ?(n))
This is often computed using the extended Euclidean algorithm. Using the pseudocode in the Modular integers section, inputs a and n correspond to e and ?(n), respectively.
d is kept as the private key exponent.](https://i.imgur.com/YAYW1sC.png)
Choose two distinct prime num…

"Your robot puppy is so sweet…

Barbie: 'God gave men brains …

Skipper asks Barbie for help …

"I'm telling mom!" yells Skip…

"Steven and Brian haven't com…

Steve plugged in the monitor …

"Your robot puppy is so sweet…

I am Bizzaro Stormy.

"Maybe you should let me and …

Mr. Stallman didn't look half…

Barbie pitches her ideas to t…

I AM BIZZARO STORMY

"Now that I'm making the desi…

Mira la tonta pollas de la Ba…

"Brian..." asks Barbie, her e…

"At the moment I'm only creat…

"I'm first creating the desig…

Why were you looking at this …

Barbie types furiously on the…

"MY LEGS ARE BROKEN!"
- said…

When Barbie puts her flash dr…

"It will go faster if you ins…

After class, Barbie meets wit…

After class, Barbie meets wit…
more (171 pages)