Base64 encryption is a lie

Published

In this guide

Calling Base64 “encryption” is dangerous. Encoded passwords, API keys and tokens are still readable by anyone who pastes them into a decoder.

This article shows real leak patterns and what to use instead: HTTPS, password hashing, and proper secret storage.

After reading, try the JWT decoder and secret redactor — both run locally in your browser.

Try these private tools next

Search for “Base64 encryption” and you will find thousands of questions, tutorials and even production code that treat Base64 as a way to protect data. It is not. Base64 is an encoding: a reversible, public, key-less transformation. Calling it encryption is like calling a translation into French “encryption”.

A two-second “attack”

cGFzc3dvcmQxMjM=

Paste it into any Base64 decoder and you get password123. No key, no brute force, no skill. Anyone who sees the value knows the secret.

Where people get hurt

  • Kubernetes Secrets. The values in a Secret manifest are Base64-encoded, so many people assume they are encrypted. They are not: anyone with read access to the manifest (or a Git repository where it was committed) has the plaintext. Use encryption at rest, sealed secrets or an external secret manager.
  • HTTP Basic authentication. Authorization: Basic dXNlcjpwYXNz is just user:pass. Basic auth is acceptable only over HTTPS. Decode such a header with the Basic Auth decoder to see for yourself.
  • JWT payloads. The payload of a JSON Web Token is readable by anyone who has the token. The signature prevents modification, not reading. Never put secrets in a JWT payload — check what yours contain with the JWT decoder.
  • “Obfuscated” API keys in mobile apps and front-end code. Base64-encoding a key in a JavaScript bundle protects nothing; automated scanners decode Base64 routinely.
  • Configuration files and URLs with “encrypted” passwords that are really just Base64.

Encoding vs encryption vs hashing

Purpose Needs a key? Reversible? Examples
Encoding Represent data in another format No Yes, by anyone Base64, hex, URL encoding
Encryption Keep data confidential Yes Only with the key AES-GCM, ChaCha20, RSA
Hashing Fingerprint / verify data No No SHA-256, bcrypt, Argon2

What to use instead

  • Storing passwords: hash them with Argon2id, bcrypt or scrypt. Never encrypt or encode passwords.
  • Protecting data: encrypt with a vetted library (libsodium, the Web Crypto API, your platform’s KMS) using authenticated encryption such as AES-GCM.
  • Transmitting data: use TLS (HTTPS).

Base64 still has a role here: encrypted data and hashes are binary, and Base64 is a great way to store that ciphertext in JSON or a database text column. Just remember the order: encrypt first, then encode.

Întrebări frecvente

Can Base64 hide my password?

No. Decoding Base64 needs no secret. Never store or transmit passwords as Base64 alone.

Is Base64URL safer?

No. Base64URL only changes the alphabet for URLs; it is still encoding, not encryption.

Instrumente și ghiduri conexe

Comentarii (0)

Întrebări, idei sau o eroare în „Base64 encryption is a lie”? Lăsați un comentariu, evaluați instrumentul sau răspundeți altora.

Nu există încă comentarii. Fiți primul care își împărtășește părerea!

Lăsați un comentariu

Evaluați acest instrument:
Esc
↑ ↓ mutați↵ deschidețiEsc închideți