So I am doing a challenge to break an encryption and have been stuck on one of the equations. $$c = K^e\mod n$$ I know $c,e$ and $n$ all of which are very very large numbers. I know I have to get $K$ as it is the only way to reverse the next set of equations but I cannot figure out how to get $K$ from this.
Asked
Active
Viewed 540 times
1 Answers
1
Use Euclidean Algorithm to find the gcd of $e$ and $\varphi(n)$ as their linear combination (which is hopefully $1$ otherwise we don't have a solution guaranteed for all $c$). Suppose $ae\equiv 1 \operatorname{mod} n$. Then take $c$ to the power of $a$ gives you $K$.
Fermat's Little Theorem is the reason behind the mathematics. The difficulty here should be finding $\varphi(n)$, but that's why the encryption works. It is meant to be difficult; but knowing the factorization of $n$ would make it easy. That's why those who know the factorization would be able to decode, and those who don't won't.
Also you might wish to look up RSA algorithm for more information.

August Liu
- 464
-
So I know of RSA but maybe why this has me a little stumped is that e is made up of the modular inverse of a prime number and φ(n) which on RSA looks more like the decryption algorithm not the encryption one. While n is pretty similar except that it is made up of 3 primes not 2 – Miki0099 Nov 22 '20 at 10:51
-
@Miki0099 I don't do CS but I thought the fact that one is able to decrypt should be part of RSA as well? Anyways this is the explanation why (and how). – August Liu Nov 22 '20 at 17:34