An RSA key pair consists of a Private Key and a Public Key. The RSA algorithm is often used for digital signature verification and key exchange problems. The Public Key is used to encrypt the data and the Private Key is used to decrypt the encrypted data.
The RSA Public Key Generator algorithm is based on the difficulty in solving the ”factoring problem”. The factorization problem is to find all primes of a given number n. When n is large enough and is the product of several large primes, the problem is considered complicated. For RSA, n is usually at least 512-bit and is the product of two large primes.
Locker uses RSA-2048, which has 617 decimal digits (2,048 bits) and is the largest of the RSA numbers. RSA-2048 may not be factorizable for many years to come unless considerable advances are made in integer factorization or computational power in the near future.
An RSA key pair is generated with these steps:
- Pick 2 prime numbers and .
and should be equally large and of similar bit-lengths for extra resistance against brute-force attacks.
- Calculate , with being the Carmichael function. Furthermore, and are prime numbers so
with being the least common multiple of the 2 numbers.
- Pick a prime number such that
with being the greatest common factor of 2 numbers.
- Find such that
- The public key is the tuple and the secret key is .