This crypto challenge is basically an RSA-like encryption service.
First the program prints the encrypted version of the flag prepended by X:
and 68 bytes from urandom (thus those have supposedly high-entropy). The encrypted hex-string are always about 1024 bit long.
After the encrypted flag, the challenge let you type in maximum 100 input to be encrypted. The inputs must be in hex-string representation and the maximal length is 15byte (after hex decode). The trick in the encryption is the padding, as all of the inputs are prepended with the X:
characters. This effectively means if you input x
, then the challenge will process (0x583a20 << (len(x)*8)) + x
.
The real twist of the challenge is the fact, that there's no obvious way to obtain even n
(the modulus) or e
(the public exponent). From the source code it seem like n, e, d
are read from a file, but d
not used at all (as ther