2022-01-31 19:15:01 +00:00
|
|
|
= RSA =
|
2022-01-31 19:30:01 +00:00
|
|
|
|
|
|
|
RSA is an asymetric encryption algorithm based on the difficulty of factoring
|
|
|
|
large prime numbers.
|
|
|
|
|
|
|
|
== algoirthm ==
|
|
|
|
|
|
|
|
1) choose some p and q
|
|
|
|
* where p and q are very large primes
|
|
|
|
* n = p * q
|
|
|
|
2) T = (p-1)(q-1)
|
|
|
|
* known as eulers totient
|
|
|
|
3) choose 2 values e and d
|
|
|
|
* where (e * d) mod T = 1
|
|
|
|
* where e < T
|
|
|
|
* [[../math/relative_prime]] with T and N
|
|
|
|
4) we now have our keys
|
|
|
|
* n and e are public keys
|
|
|
|
* n and d are private keys
|
|
|
|
|
|
|
|
=== example ===
|
|
|
|
|
|
|
|
p = 2; q = 7
|
|
|
|
|
|
|
|
therefore,
|
|
|
|
|
|
|
|
n = 14; T = 6
|
|
|
|
|
|
|
|
Due to restrictions, choose e = 5
|