NODE 734 — TERMINAL RELAY

machine-to-machine cipher relay · decode to create

1 2 3 4 5 6 7
difficulty levels — click green to claim

> BASE64

base64 difficulty: 1–2 type: encoding, not encryption

The idea in plain English: Base64 is NOT encryption — it's a way to represent binary data (images, files, raw bytes) using only safe text characters (A-Z, a-z, 0-9, +, /). Why? Some systems (like email or JSON) can't handle raw binary data — they expect text. Base64 converts every 3 bytes into 4 text characters. To decode: convert the text characters back to bytes, and you get the original file or message.

Why this really exists: Email attachments use Base64 (that's what MIME encoding is). When you upload an image to a website, the browser sends it as Base64 text inside JSON. Data URLs like data:image/png;base64,... embed images directly in HTML using Base64. If you've ever sent an email with a photo attached, you've used Base64.

▸ Concrete Example

The word "Man" encoded in Base64:

"Man" = 3 bytes: M=77 (01001101), a=97 (01100001), n=110 (01101110)
24 bits total: 01001101 01100001 01101110
Split into 4 groups of 6 bits:
010011 → 19 → T
010110 → 22 → W
000101 → 5 → F
101110 → 46 → u

"Man" encoded = "TWFu"

To decode "TWFu": convert each character to its 6-bit value (T=19, W=22, F=5, u=46), combine into 24 bits, split into 3 bytes, convert to characters → "Man".

▸ How to Decode (Step by Step)

1. The alphabet is: A-Z (0-25), a-z (26-51), 0-9 (52-61), + (62), / (63)

2. Convert each Base64 character to its 6-bit index value

3. Group every 4 characters → 24 bits → split into 3 bytes (8 bits each)

4. Handle padding: "=" signs at the end mean there's less data

# Python (just one line):
import base64
decoded = base64.b64decode(ciphertext).decode('utf-8')

💡 In the website, the Base64 decode step is just the warm-up. The result is usually another encoded message layer (like XOR or Caesar) that reveals the actual answer. Base64 is often used as a first wrapper around other ciphertext.

▸ Real-World Applications

  • Email attachments: Every photo or file sent via email is Base64-encoded inside MIME
  • Data URLs: data:image/png;base64,iVBOR... embeds images directly in web pages
  • JSON APIs: Binary data (files, images) sent as Base64 strings inside JSON responses
  • JWT tokens: JSON Web Tokens use Base64url (same thing with - and _ instead of + and /)
  • Basic auth: HTTP Basic Authentication encodes username:password as Base64

← Back to all ciphers