In this challenge, we get a message.eml file containing an email:
Hello Mr Jingles,
We got the reindeer as you requested. There is a problem though. Its nose is so red and bright and makes it very hard to hide him anywhere near north pole. We have moved to a secret location far away. I have encrypted this information with your public key in case you know who is watching.
Applications such as Outlook block downloading the file due to it's "malicious nature", but we can open the .eml file in VS Code easily and extract two things:
Firstly, there is a secret.enc file with base64-encoded ciphertext:
And bingo bango, we get the flag as HTB{w34k_3xp0n3n7_ffc896}.
We can easily import the public key in Python and read the values for N and e using the Pycryptodome:
We can throw N into FactorDB to see if the factors are known, but they are not. The more notable observation is that e=3, which allows us to perform a cube root attack on the ciphertext.
The logic here is simple: because the message m is quite short and the public modulus N is quite large, a small value of e such as 3 may make it such that me<N. This makes the modulus ineffective as me=memodN and we can simply take the eth root of the ciphertext to recover the plaintext.