Basic Text Cryptography Focused Around CTFs

The first type of "code" you will need to know for CTFs is Base64. Base64 is extremely common in CTFs, and therefore is at the top of this list. You can use these websites to convert to and from:

Encode Decode

Base64 is an easily identifiable code by its sparing but still existent use of numbers and constant use of near-alternating capitalization.

Some Base64 strings will also have one or two equal signs at the end of them, making it even easier to identify.



An example Base64 string would be: SGVsbG8gc3dpZnRjZWRh This string converts to: Hello swiftceda

For the equal signs function, the best case in point example is this string: VGhpcwppcwphCmxvbmcKQmFzZTY0CnNlbnRlbmNlCmtpbmQKb2Y=

Which converts to:

"This is a long Base64 sentence kind of"

Once you get a feel for Base64, it becomes one of the easiest to spot. Although we started off with a basic cipher, there's an even easier cipher, the Caesar Cipher.

It can be encoded and decoded here: Caesar

The Caesar Cipher shifts the alphabet by a certain amount of letters to create it's effect.

This is a string Caesar shifted 7 letters: aopz pz h jhlzhy jpwoly dpao zopma 7

It decodes to: this is a caesar cipher with shift 7

At this point we've used a website called cryptii. I would recommend using this as it is one of the best, easiest cipher websites I've seen so far, and has plenty of common CTF crypto converters. (Honorable mention to dcode.fr )

Speaking of honorable mentions, lets talk about hexadecimal and hashes. These aren't ciphers, but they are commonly used to obfuscate strings.

An example hexadecimal string: 6865785f6465636f646564

Decoded: hex_decoded

Hexadecimals can be decoded using this website: Hex

Next are MD5 and SHA1 hashes.

MD5 hash: a9d3ee7dc268399430050582174f7f07

Decode: md5 hash

SHA1 hash: 8B30C7CB569B5C3D48DF4C1A3509E9C169F4D319

Decoded: sha1 hash

Now, hashes are a little harder, because although they do have a mathematical method through which they're created, they can't be as easily cracked as other cryptography methods.

However, you may be able to decrypt some of your hashes here: Hash Killer.

If you want to crack them yourself, I'd recommend hashcat: Hashcat.

Next up is morse. This one is easily identified because it only uses periods, hyphen, and slashes.

It has a translator here: Morse.

It is not as common as other cryptography methods but it does pop up.

Morse: -- --- .-. ... . / .. ... / -.-. --- --- .-..

Decoded: morse is cool

One of the more interesting families of ciphers is the ROT family.

ROT5 only works on numbers: TEST 123

Becomes: TEST 678

ROT13 only works on letters: TEST 123

Becomes: GRFG 123

ROT18 is a combination of them both: TEST 123

Becomes: GRFG 678

Then there is the one that is really interesting and spices up the entire family.

ROT47: TEST 123 !!>>

Becomes: %t$% `ab PPmm

Again, Cryptii is your best friend on this one: Rot13.

Another ROT47 example: This would be a regular sentence turned into Rot47. Oh the horror.

Becomes: %9:D H@F=5 36 2 C68F=2C D6?E6?46 EFC?65 :?E@ #@Ecf] ~9 E96 9@CC@C]

Although ROT5 and ROT13 are slightly more common than ROT47, ROT47 still has widespread use.

Next cipher is the Vigenere cipher, which is a keyed cipher. Keyed ciphers require passwords.

Example: A regular sentence that by no means contains any hidden message.

Key: hiddenmessage

Becomes: h zhjyymv kwnziukh wlnf fq fo sihvv fsafeafs grf plghrz qwksgkl.

Vigenere works by putting the key in front of the alphabet to create a new one. It frustrates many due to its similar appearance to Ceaser.

Decoder: Vigenere

An honorable mention here is the AZ126 cipher.

A = 1, Z = 26.

Example: tada

Becomes: 20;1;4;1

Like all the others, there's a decoder: AZ126

Next is subsitution ciphers (A=B, for instance). These are common but not as fancy as others.

There's an excellent site by Edwin Olson to crack these: Quipquip.

Now for one of my personal favorites; The Enigma Machine. It was a cipher used in WWII and has as many combinations as you need to obscure and obfuscate.

Example: The quick brown fox jumps over 13 lazy dogs.

Put through a Enigma M3 Reflector UKW B

Rotor 1 = VIII, Position 3, Ring 1

Rotor 2 = IV, Position 26, Ring 1

Rotor 3 = VIII, Position 1, Ring 2

Becomes: fcgcl cjiun paljp witjh vjnis zsxfl isj

This one is very complicated, so just play around with it till you get a feel for it Enigma.

Last but not least, brainfuck Brainfuck.

Example: aw heck

Becomes: --[----->+<]>-----.+[--->+<]>+.+[---->+<]>++.-[--->++<]>--.---.--.++++++++.

It is extremely complicated, and if you don'nt know what it is, you're absolutely dead trying to crack it, so it's good to get introduced to it now. Seeing as it has a very unique ciphering method, it's easily identifiable.

Well, that's a majority of the ciphers, codes, and other crypto methods you'll need for CTFs and more.

- Sentinel#2295 on Discord