Simple implementation of RSA algorithm, asymmetric cryptography algorithm
The concept of RSA Algorithm is generating public and private keys in 512 bits.
β’ Choose two random prime numbers p & q using Miller-Rabin Test
β’ Compute n =p*q
β’ Compute euler phi = (p-1) (q-1)
β’ Choose e, random prime number in specific range
β’ Then get the key of (n,e)
β’ C = m^e mod n
β’ C^d mod n
β’ e^-1 mod phi
1- Get U & R from the prime number
2- Use Square and multiply algorithm to allow fast exponentiaition
1- Modular representation of y into p and q
π¦π=π¦ πππ π
π¦π=π¦ πππ π
2- Compute exponents
ππ=π πππ (πβ1)
ππ=π πππ (πβ1)
3- Compute exponentiation
π₯π=π¦πππ πππ π
π₯π=π¦πππ πππ π
4- Compute C:
πΆπ=πβ1 πππ π
πΆπ=πβ1 πππ π
5- Compute X
π = {(π.πΆπ)ππ + (π.πΆπ) ππ} πππ π