Discrete Mathematics - Modular Arithmetic:
Say we have the prime numbers 7 and 17 and with encryption exponent 5. How to construct an RSA crypto based on these prime numbers and encrypt for example the number 9?
Thanks!
Discrete Mathematics - Modular Arithmetic:
Say we have the prime numbers 7 and 17 and with encryption exponent 5. How to construct an RSA crypto based on these prime numbers and encrypt for example the number 9?
Thanks!
Copyright © 2021 JogjaFile Inc.
You have $p=7 ,q= 17 $ and so $ n = 7*17 = 119$ and $e = 5$ and $ \phi(n) = (p-1)(q-1) = 96$ you have the encryption key and you need the decryption key to fulfill the congruence $ e d = 1 \mod \phi(n) = 1 \mod 96$ which is $d = 77$.
We know from Euler that $a^{\phi(n)} = 1 \mod n$ when $gcd(a,n)=1$ and since $e d =1 \mod \phi(n)$ we will have that $ a^{e d} = a \mod n$ and so $ (a^e)^{d} = a \mod n$.
Now you encrypt $9$ to $ 9^{5} = 25 \mod 119$.
If you want to decrypt $25$ just compute $ 25^{77} = 9 \mod 119$