Challenge Description
As the name suggests, this challenge revolves around the concept of the caesar cipher.
The downloaded file, new_caesar.py
is used to encrypt the flag, and the encrypted flag is given in the challenge description:
mlnklfnknljflfjljnjijjmmjkmljnjhmhjgjnjjjmmkjjmijhmkjhjpmkmkmljkjijnjpmhmjjgjj
Script used to encrypt the flag
The following is how the encryption script,
new_caesar.py
looks like. I have added some comments to understand the code more easily.
So how do we proceed? We currently have 2 unknowns, flag
and key
. They have both been replaced with “REDACTED” in the script provided.
Decryption Script
Since we know how the string provided above was encrypted initially, we can come up with a decryption script to reverse engineer the flag.
This script will allow us to find the flag through a little bruteforcing. Below shows a portion of the output when we run the script.
Key: e, Decrypted: ihjghbjgjhfbhbfhfjfeffiifgihfjfdidfcfjfffiigffiefdigfdfligigihfgfefjflidiffcff
Decoded: qQqWYTUVYSRYUXUSS[VTY[RU
Key: f, Decrypted: hgifgaifigeagaegeiedeehhefhgeiechcebeieeehhfeehdechfecekhfhfhgefedeiekhcheebee
Decoded: v`@`FHCDwEvHBrAHDGuDsBuBJuuvECHJrtAD
Key: g, Decrypted: gfhefphehfdpfpdfdhdcddggdegfdhdbgbdadhdddggeddgcdbgedbdjgegegfdedcdhdjgbgddadd
Decoded: et_tu?_5723f4e71a0736d3b1d19dde4279ac03
Key: h, Decrypted: fegdeogdgecoeocecgcbccffcdfecgcafacpcgcccffdccfbcafdcacifdfdfecdcbcgcifafccpcc
Decoded: TcNcd.N$&!"U#T& P/&"%S"Q S (SST#!&(PR/"
Key: i, Decrypted: edfcdnfcfdbndnbdbfbabbeebcedbfbpepbobfbbbeecbbeabpecbpbhececedbcbabfbhepebbobb
Decoded: CR=RS↔=‼§►◄D↕C§▼O▲§◄¶B◄@▼B▼↨BBC↕►§↨OA▲◄
As seen, some of the decoded strings are weird-looking. After skimming through the decoded strings, we narrow our options to only 1 possible string.
Flag
picoCTF{et_tu?_5723f4e71a0736d3b1d19dde4279ac03}