Skip to content

Challenge data

  • Name: Really Secure Algorithm Again
  • Category: Crypto
  • Points: 170

Solution

This challenge had only a file with the following content:

e = 65537
N = 25693197123978473
enc_flag = ['0x2135d36aa0c278', '0x3e8f43212dafd7', '0x7a240c1672358', '0x37677cfb281b26', '0x26f90fe5a4bed0', '0xb0e1c482daf4', '0x59c069723a4e4b', '0x8cec977d4159']

Help me find out the secret to decrypt the flag

Quickly, we can understand that N (which is the result of P and Q) is extremelly small. With the dumbest python factorization script, you can factorize it and get the value of both primes.

Once factorized: * P = 150758089 * Q = 170426657

(or the other way around, is the same)

Once we have the primes, we have all to decrypt the message. I used RsaCtfTool to make things even quicker:

python RsaCtfTool.py -p 150758089 -q 170426657 -e 65537 --uncipher 0x2135d36aa0c278
python RsaCtfTool.py -p 150758089 -q 170426657 -e 65537 --uncipher 0x2135d36aa0c278
python RsaCtfTool.py -p 150758089 -q 170426657 -e 65537 --uncipher 0x3e8f43212dafd7
python RsaCtfTool.py -p 150758089 -q 170426657 -e 65537 --uncipher 0x7a240c1672358
python RsaCtfTool.py -p 150758089 -q 170426657 -e 65537 --uncipher 0x37677cfb281b26
python RsaCtfTool.py -p 150758089 -q 170426657 -e 65537 --uncipher 0x26f90fe5a4bed0
python RsaCtfTool.py -p 150758089 -q 170426657 -e 65537 --uncipher 0xb0e1c482daf4
python RsaCtfTool.py -p 150758089 -q 170426657 -e 65537 --uncipher 0x59c069723a4e4b
python RsaCtfTool.py -p 150758089 -q 170426657 -e 65537 --uncipher 0x8cec977d4159

Answer was:

[+] Clear text : infe
[+] Clear text : rnoC
[+] Clear text : TF{R
[+] Clear text : SA_k
[+] Clear text : 3yS_
[+] Clear text : t00_
[+] Clear text : SmAl
[+] Clear text : l}

Flag

infernoCTF{RSA_k3yS_t00_SmAll}