Crypto - RustSA
Description

Downloads
Solution
In this challenge we're given a Rust implementation of RSA.
If you throw the code into any LLM, you'll immediately know that there is a flaw in the implementation of the mod_exp function. It only does x^y and does not do the modulo part.
If we take a look at the given ciphertext:
I thought it was unusual. With x^65537, there is no way the resulting ciphertext is so small. If we take a closer look at the given mod_exp implementation again, we'll notice that the result is of u128 type (and actually the challenge text already hinted towards that.)
The next step is to figure out how Rust handles the overflow and apparently, it is via a simple wrapping arithmetic. From Deepseek:

Final solve script:
Last updated