Vigenere then Base64: Reversing a Classical Cipher Wrapped in Base64

Cryptography Level 3/4 ~5 min 2026-07-31

The challenge

An old internal tool 'protects' strings by running them through a Vigenere cipher and then base64-encoding the result. You found one such blob in a config backup. Decode the base64, undo the Vigenere with the key 'acme', and submit the recovered flag (HDNA{...}).

What you'll learn

  • Recognise base64 as the outer transport layer by its character set and padding
  • Identify a classical letter cipher by which characters it leaves untouched
  • Decode a Vigenere cipher with a known key
  • Peel two stacked transforms in the correct inverse order
  • Explain why classical ciphers are puzzles, not real protection

Skills tested

Layered decodingVigenere cipherClassical cryptanalysis basics

Prerequisites

  • Comfort with base64
  • Knowing what a substitution or shift cipher is

How it works

The Vigenere cipher shifts each letter by a different amount, driven by a repeating keyword. It looks more sophisticated than a single Caesar shift, and for centuries it was called unbreakable - but it is a classical cipher with a fixed key alphabet, and it falls to a known key instantly or to frequency analysis without one. Wrapping its output in base64 only changes how the bytes are stored; it adds no security.

The tell that this is a letter cipher and not a byte-level one is what it leaves alone. Vigenere only touches a-z and A-Z; digits, braces and underscores pass straight through. So in the decoded ciphertext you can already see the flag's {, } and _ in place, with only the letters scrambled. That is your cue to add a Vigenere step rather than an XOR or hex step.

Peel in reverse order. Decode the base64 first to get the ciphertext, then add Vigenere and type the key acme. The recipe runs base64-decode then Vigenere, and the plaintext flag resolves in the output. The other operations (ROT, XOR, hex, atbash, reverse, URL-decode) are decoys - ROT is the closest trap, but it uses a single fixed shift, not a repeating keyword, so it cannot undo Vigenere.

Common mistakes

  • Reaching for ROT instead of Vigenere. ROT is a single fixed shift; Vigenere uses a repeating keyword, so ROT alone will not recover the flag.
  • Trying XOR. The non-letter characters are untouched, which rules out a byte-level XOR - this is a letter cipher.
  • Skipping the base64 decode. Vigenere has to run on the decoded ciphertext, not the base64 wrapper.
  • Guessing the key. The key 'acme' is in the brief; do not brute-force it.

How to defend against it

For defenders and builders, the takeaway is that classical ciphers like Vigenere are recreational, not protective. If an internal tool 'encrypts' secrets this way, treat those secrets as plaintext. Recognising a classical cipher quickly saves time in CTFs and in real triage of legacy systems.

  • Never protect real secrets with classical ciphers - use vetted authenticated encryption with a managed key.
  • When auditing legacy tools, flag any custom or classical 'encryption' as effectively no protection.
  • During triage, note which characters a transform leaves untouched to tell letter ciphers from byte-level ones.
  • Remember that base64 is encoding, not encryption - it never adds confidentiality.

Full solution

Pro and Max members unlock the complete step-by-step walkthrough.

Go Pro

Community stats

113 completions
88% success rate
ediopaulo0x6f First blood

Related Daily Hacks

18,000+ Hackers 100+ Labs & Courses Free
Start Hacking Free