Rivest, Shamir, & Adleman (RSA) Algorithm
- is an asymmetric encryption algorithm
- invented in April 1977
RSA - Introduction
RSA Creation Steps
Using modular exponentiation for encryption
- ππ πππ π β‘ π
Given π, π, π it is EASY to compute π (encrypting π)
- ππ πππ π β‘ ?
Given π, π, π it is HARD to compute π (decrypting π)
- ?π πππ π β‘ π
Determine what is needed for decryption
Find π to βundoβ π
- ππ πππ π β‘ π
- ππ πππ π β‘ π
With modular arithmetic the 2 equations above result in:
- πππ πππ π β‘ π
The problem is figuring out what value to choose for π and π
Introducing phi function π·(π)
π·(π) is the number of integers π in the range 1 β€ π β€ π for which the greatest common divisor πππ(π, π) is equal to 1.
- π·(π πππ-ππ’ππππ) is HARD to compute
- π·(πππππ-ππ’ππππ) is EASY to compute, π·(πππππ-ππ’ππππ) = πππππ-ππ’ππππ - 1
- π·(π * π) = π·(π) * π·(π)
Choosing π to be equal to πππππ-πππ * πππππ-π‘π€π, then:
- π·(π) = π·(πππππ-πππ) * π·(πππππ-π‘π€π)
Thus, π·(π) is EASY to compute when its prime-factorization (i.e. πππππ-πππ * πππππ-π‘π€π) is known. The prime-factorization of large π is HARD to compute.
Merging π·(π) with modulo exponentiation
Eulerβs theorem states, for any π,π, and gcd(π,π) = 1 then:
- ππ·(π) β‘ 1 πππ π
Rearranging Eulerβs theorem with modular arithmetic:
- ππ·(π)π β‘ 1π πππ π
- ππ·(π)π β‘ 1Β πππ π
- πΒ·ππ·(π)π β‘ πΒ·1 πππ π
- ππ·(π)π+1 β‘ π πππ π
Now we have modulo exponentiation that depends on π·(π)!
Thus, the values for π and π:
- π = [π·(π)π+1] / π
RSA - Usage
Algorithm |
Example |
|---|---|
|
private-public key pair - setup:
private-public key pair - encryption/decryption:
|
private-public key pair - setup:
private-public key pair - encryption/decryption:
|