Description
Can you get the real meaning from this file. Download the file here.
Setup
Download the enc_flag file from the challenge artifacts.
Work locally; no remote service is needed once you have the blob.
wget https://artifacts.picoctf.net/c_titan/3/enc_flag && \
cat enc_flagSolution
Walk me through it- Step 1Read the initial Base64cat enc_flag prints a long Base64 string ending in ==. Decode it once to reveal a Python byte literal (b'...').bash
base64 -d enc_flagLearn more
Base64 is an encoding scheme, not encryption. It converts arbitrary binary data into a safe printable-ASCII string using 64 characters (A-Z, a-z, 0-9, +, /). Every 3 bytes of input become 4 Base64 characters, which is why Base64-encoded data is always about 33% larger than the original.
The
==at the end is padding. Base64 works in 3-byte groups; if the input isn't a multiple of 3 bytes, one or two=characters are appended as placeholders so the length is always a multiple of 4.Base64 is everywhere: email attachments (MIME), embedding images in CSS (
data:image/png;base64,...), JWTs (the header and payload are Base64URL-encoded), and passing binary data through systems that only handle text. Seeing a string that ends in==or is unusually long and uses only alphanumeric characters is a strong hint to try Base64 decoding it. - Step 2Strip quotes and decode againRemove the leading b' and trailing ' (cut -d "'" -f2 works on the typical bytecode print format), then Base64-decode the inner string to obtain a Caesar-shifted message.bash
base64 -d enc_flag | cut -d "'" -f2 | base64 -dLearn more
The
b'...'wrapper is Python's syntax for a bytes literal. When Python prints a bytes object it adds this prefix so you can tell it apart from a regular string. It's not part of the data, just how Python represents it in text form.cut -d "'" -f2splits on the single-quote character and takes the second field, which works cleanly when the inner Base64 contains no quotes (it never will, since the Base64 alphabet isA-Za-z0-9+/=) and there is no whitespace before the openingb'. If you ever see surrounding whitespace or a different quoting style (b"..."), reach forsed -E "s/^b['\\"]//; s/['\\"]$//"instead.The key insight: encoding is not encryption. No secret key is involved; anyone who recognizes the encoding can reverse it. Real encryption (AES, RSA) requires a key you don't have. Encoding is purely a format transformation.
- Step 3Apply ROT13 / CaesarThe decoded text starts with something like 'cvpbPGS{...}' - a Caesar-shifted picoCTF{...}. Use CyberChef's ROT13 (the easiest path) or pipe through bsdgames caesar, then scan the 25 candidate lines for the one starting with 'pico'.bash
base64 -d enc_flag | cut -d "'" -f2 | base64 -d | caesarcaesarfrom bsdgames spits out a single line for each shift 1-25 with no labels, so the readable line jumps out by eye. CyberChef's ROT13 recipe with "Brute force all rotations" checked is the friendliest option.Learn more
A Caesar cipher shifts each letter by a fixed number of positions in the alphabet. ROT13 is a Caesar cipher with a shift of 13; it's its own inverse (applying it twice gives you back the original), which made it popular for hiding spoilers in early internet forums.
With only 25 possible shifts, the right one is whichever produces the recognizable
picoCTF{prefix. That single landmark, plus the known flag format, is the only signal you need; full English frequency analysis is overkill on a 40-character flag and is the standard tool for the Vigenère-style longer ciphertexts where you don't already know the plaintext skeleton.Historically, Julius Caesar reportedly used a shift of 3. The cipher was reasonably secure in an era when most people were illiterate, but provides zero real security today. It's the ancestor of the Vigenère cipher (a repeating-key Caesar), which itself was cracked in the 1800s using the Kasiski test.
No-terminal path (recommended)
If you don't want to fight quoting in the shell, the fastest solve is entirely in the browser. Open the Base64 Decoder, paste the contents of enc_flag, and decode. Strip the b' wrapper from the result, paste that back in, and decode again. Drop the final string into the ROT / Caesar Cipher tool and click Try all 26 shifts; the line starting with picoCTF{ is the flag.
Flag
picoCTF{caesar_d3cr9pt3d_b20...}
Two Base64 layers plus a Caesar shift are all that stand between you and the flag.