CTF crypto tools

Nothing leaves your browser

Paste a challenge string. The chain decoder peels off Base64, hex, ROT13, XOR and more, layer by layer, until the flag shows up. Plus XOR key finding and classical ciphers with automatic cracking.

Try:

Paste something on the left. Recognized layers: Base64, Base32, Base58, Ascii85, hex, binary, octal, decimal, URL, HTML entities, escapes, Morse, gzip, zlib, ROT13, ROT47, Atbash, Caesar, reversed text and XOR.

Spot the layer

Which layer is it?

CTF challenges love to wrap the flag several times. Each layer has a look you can learn. Here is flag{hi} in each of them, calculated with the same code as the decoder above.

LayerHow to spot itExample
Base64A–Z, a–z, 0–9, + and /, often = at the endZmxhZ3toaX0=
Base32Only A–Z and 2–7, padded with = to multiples of 8MZWGCZ33NBUX2===
Base58Letters and digits without 0, O, I and lJ8dppbLkkY4
Ascii85Printable punctuation soup, sometimes inside <~ ~><~Ao(mgHY@,A~>
HexPairs of 0–9 and a–f, maybe with 0x or \x666c61677b68697d
BinaryGroups of eight 0s and 1s01100110 01101100
Octal codesGroups of three digits 0–7146 154 141 147 173 150 151 175
Decimal codesNumbers from 0 to 255102 108 97 103 123 104 105 125
URL decode%XX sequences like %7B%7B%68%69%7D
HTML entities&#102; or &#x66; or &amp;&#102;&#108;&#97;&#103;
Escape sequences\x66, \u0066 or \146\x66\x6c\x61\x67
Morse codeDots and dashes..-. .-.. .- --.
ROT13Letters moved 13 placessynt{uv}
ROT47All printable characters moved 47 places7=28L9:N
AtbashAlphabet reversed, A↔Zuozt{sr}
ReverseText written backwards, e.g. == at the start}ih{galf
Under the hood

How the chain decoder decides

Formats with a clear signature, like hex, binary, URL encoding or Base64 with padding, are always tried. Ciphers without a signature, like ROT13, Atbash, Caesar or reversed text, only count when the result gets better: when a flag appears, when the text reads clearly more like English, or when it suddenly fits a format again. That is how Base64 → ROT13 → hex is found even though ROT13 alone never looks like progress.

The search goes up to twelve layers deep. A flag beats readable text, and between two answers the shorter chain wins. If the result is still unreadable bytes, try the XOR tab, or check whether the decoder found a file signature such as gzip, PNG or ZIP.

XOR

Getting the XOR key back

XOR with the same key twice gives back the original: (m ⊕ k) ⊕ k = m. And if you know a part of the plaintext, c ⊕ m = k gives you the key. Since most flags start with something like flag{, the first five bytes of the ciphertext give away up to five bytes of the key.

Example: 0d5f180c48015b4104 is flag{x0r} XORed with k3y. Paste it into the XOR tab and click “Get key” with the known plaintext flag{. The tool notices that the leaked bytes repeat every three characters and decrypts the rest.

Classical ciphers

Tell them apart

Letters keep their frequency

The index of coincidence is close to 0.066, like English. Then it is a single substitution (Caesar, Atbash, Affine) or a transposition (Rail fence). If the most common letters are E, T and A, letters only changed places: try Rail fence.

Flat frequencies

An index near 0.04 means several alphabets, usually Vigenère or Beaufort. The cracker estimates the key length from the columns and solves each column like a Caesar shift.

Even length, no doubled pairs, no J

Typical for Playfair: it encrypts pairs of letters in a 5 × 5 square. You need the keyword, or a lot of patience.

Example: aol mshn pz ulhy is Caesar with shift 7, and TLSDHFAIHDEEGIN is Rail fence with three rails.

FAQ

Questions about the CTF tools

What is a chain decoder?

A tool that peels off several layers of encoding in a row, for example Base64, then ROT13, then hex, then XOR. It tries the formats that fit, keeps the steps that make the text more readable and stops at a flag or at plain text. Every step is shown, so you can follow and copy each layer.

Which encodings and ciphers does it detect?

Base64 (also URL-safe), Base32, Base58, Ascii85, hex (also with 0x, \x or colons), binary, octal and decimal codes, URL encoding, HTML entities, escape sequences, Morse code, gzip and zlib, ROT13, ROT47, Atbash, Caesar, reversed text, single-byte XOR and XOR with a short key that the flag format gives away.

How do I find an XOR key?

If one byte is the key, try all 255 and keep the readable result. If the key is longer and you know how the plaintext starts, XOR the ciphertext with that start, for example “flag{”. The bytes you get are the key. Without a known start, the key length can be estimated from bit differences between blocks, then each position is solved like a one-byte key.

Can it decode a hash like MD5?

No. A hash is a one-way fingerprint, not an encoding, so there is nothing to peel off. The chain stops there. To find out what kind of string you have, use the identifier.

Is my input sent anywhere?

No. Everything runs in your browser. Nothing you paste is sent to a server or stored, so you can use it during a competition without leaking your challenge data.

Searches the list of pages on this site. What you type stays in your browser.