Modular exponentiation Updated 2025-10-14
Can be calculated efficiently with the Extended Euclidean algorithm.
The beauty of this algorithm is that because exponentiation grows really fast, there is no hope that we can ever learn all the digits of an exponential, as there is simply not enough time or memory for that. Therefore, a natural sub-question is if we can know some part of that number, and knowing the smallest digits is the most natural version of that question.
RSA (cryptosystem) Updated 2025-07-16
Based on the fact that we don't have a P algorithm for integer factorization as of 2020. But nor proof that one does not exist!
The private key is made of two randomly generated prime numbers: and . How such large primes are found: how large primes are found for RSA.
The public key is made of:
n = p*q
- a randomly chosen integer exponent between
1
ande_max = lcm(p -1, q -1)
, wherelcm
is the Least common multiple
Given a plaintext message This operation is called modular exponentiation can be calculated efficiently with the Extended Euclidean algorithm.
m
, the encrypted ciphertext version is:c = m^e mod n
The inverse operation of finding the private
m
from the public c
, e
and is however believed to be a hard problem without knowing the factors of n
.Bibliography:
- www.comparitech.com/blog/information-security/rsa-encryption/ has a numeric example