While solving a CTF challenge online, I came across a situation where I needed to decrypt a
'.enc' file that has been encrypted using someone's public key. The corresponding public key
'.pem' file was provided to me. I solved almost all other CTF challenges except this one and it has been bugging me since. I solved the first part: I have been able to decode a hint that says:
"The file file.enc could be decrypted with a private key. Using raw algorithm, every 64 bits chunk of data was encrypted at a time. You can do the same thing to decrypt using RSA."
Here's what I have tried:
Read many posts like this one online and tried to decrypt the '.enc' file: http://www.czeskis.com/random/openssl-encrypt-file.html
I tried the following command for decryption: openssl rsautl -decrypt -in public_key.pem -out key.bin. I got the this error:
no keyfile specified unable to load Private Key
Yes, but that's because private key is not provided to me. If I try to use the public_key.pem as infile, I get this error:
unable to load Private Key 139914348455592:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: ANY PRIVATE KEY
Tried the tool 'openssl' in Linux in several ways to try to decrypt the file.
Here is the 3 files zipped in tarball, if anyone wants to analyse them: http://www.filedropper.com/chaltar
Could someone please advise me on how to decrypt the '.enc' file before I give up on this challenge? I have worked long and broken the first part of the challenge, now I feel I'm so close.
- I know the tool 'openssl' will be used to solve this challenge.
- Encryption: RSA
- Files: Only three files, public_key.pem, file.enc, and a random file that I decrypted that provided the hint I wrote above.