Prime Factorization
Theorem
Every natural number can be uniquely expressed by multiplying prime numbers together.
Integer factorization problem
It is difficult to factorize large integers, which means there is no efficient algorithm that solves this problem yet. However, computing the product of a given set of prime numbers is fast. Based on this observation, we can create a one-way function, which is an invertible function that is easy to compute in one direction but hard to compute in the other direction. This one-way function is a foundational element of the RSA encryption algorithm.
Definition | One-way function
A one-way function is a function that is easy to compute for every input but hard to invert given the image of a random input.
Extended Euclidean Algorithm
Extended euclidean algorithm is used to calculate the greatest common divisor (GCD) of integers. This algorithm computes GCD of two natural numbers and and also finds two integers , such that the following relationship holds: The following pseudocode illustrates how the Extended Euclidean Algorithm works:
Pseudocode
Proof
The correctness of the Extended Euclidean Algorithm can be proven by using mathematical induction. Initially, we set the base conditions of the algorithm as follows:
Assume the statement we want to prove holds for , which is: For the case of , the following holds:
Therefore, when , is the gcd of and .