The RSA algorithm (Rivest-Shamir-Adleman) is the basis of a cryptosystem – a suite of cryptographic algorithms that are used for specific security services or purposes – which enables public key encryption and is widely used to secure sensitive data, particularly when it is being sent over an insecure network such as the internet.
<aside> 💡 Note: Euler’s totient Function → phi
</aside>
Pseudo Code
There are few conditions to be verified before the implimentation.
<aside> 💡 1 < e < phi | GCD(e,phi) == 1
</aside>
'''
pow(base, exponent, modulus)
p,q are two primes
pt-base
N = p * q
N-modulus, e-exponent (In general)
e=65537
'''
#Example
'''
p=17,q=23
N=p*q
e=65537
pt=12
ct=pow(pt,e,N)
'''
Totient Function (phi)
Multi Factor
#Python Implimentation
p=17,q=23
N=p*q
e=65537
pt=12
pow(pt,e,N)
Modular Inverse (d)