- Generating Key value pair with a multiple options for number of bits to choose from.
- Option to store Public and Private Key in .txt file.
- Encrypts a message (also gives option to import key stored by the same program)
- Option to store Encrypted Message in .txt file.
- Decrypts a message (also gives option to import key stored by the same program)
Using CreateRandom Class
- Get two different large prime numbers p and q
- Using Miller-Rabin Test
Using GenerateKeys Class
-
Let n = p * q
-
Let φ(n) = (p-1) * (q-1)
-
Choose a small, odd integer number e, where 1 < e < φ(n) and e is a co-prime to φ(n).
- Using Euclidean Algorithm
- Check calculateEncryptionExponent() method
-
Calculate the integer number d, where ed ≡ 1 mod φ(n) and 1 < d < φ(n).
- Using Extended Euclidean Algorithm
- Check calculateDecryptionExponent() method
-
The public key of the RSA is the pair PK = (n, e)
-
The secret key of the RSA is the pair SK = (n, e)
Using FME Class
-
To encrypt the message m (where m < n) using the public key PK = (n, e) following formula is used: (Fast Modular Exponent)
c := EncPK(m) = m^e (mod n).
Using FME Class
-
To decrypt the secret message c using the secret key d following formula is used: (Fast Modular Exponent)
m := DecSK(c) = c^d (mod n).