Description
This is the Custom Cyclical Cipher! Download the ciphertext here. Download the encoder here. Enclose the flag in our wrapper for submission. If the flag was "example" you would submit "picoCTF{example}".
Setup
Python scripts
Download ciphertext and convert.py to the same directory.
Run the provided script locally with Python 3.
wget https://artifacts.picoctf.net/c_titan/47/ciphertext && \
wget https://artifacts.picoctf.net/c_titan/47/convert.py
Solution
This custom cipher challenge requires reversing a Python encryption script. For another custom cryptography challenge, see Custom encryption, which involves Diffie-Hellman and dynamic XOR operations.
- Step 1Implement the inverseTranslate convert.py into a decryptor: swap lookup1/lookup2 roles, replace (cur - prev) with (cur + prev), and keep prev synced with the decrypted index.python3 decrypt.py ciphertext > decrypted.txt
- Step 2Run the extraction scriptReuse the provided snippet that prints chars at i == n^3. Port it to Python 3 so it prints the hidden phrase that becomes the flag body.python3 cubic_extract.py decrypted.txt
- Step 3Wrap the flagEnclose the final string in picoCTF{...} for submission.
Flag
picoCTF{adl...}
The cubic sampling script prints the final flag body.