Disclosure: I built the free Base64 Encoder on base64decodetool.com, and I used it for the checks in this post. Every value below is made up. None of them is a real credential.

Sooner or later someone on the team opens a Kubernetes Secret, sees a value like Tm90QVJlYWxQYXNzLTIwMjYh, and decides it looks safe enough to paste into a ticket. It isn't. That string is just a password re-encoded in a public 64-character alphabet. Anyone can turn it back in a second, with no key.

This post walks through one made-up Secret from start to finish. It shows exactly what Base64 does and doesn't do, and it covers the few habits that actually protect the value.

Encoding vs hashing vs encryption, in one table

Reversible? Needs a key? What it's for
Base64 (encoding) Yes, by anyone No Carrying bytes through text-only places (YAML, JSON, headers, email)
SHA-256 (hashing) No No Fingerprints, integrity checks (and, with a slow KDF, password storage)
AES-256-GCM (encryption) Yes, only with the key Yes Keeping data confidential

Base64 maps every 3 bytes to 4 characters from a public 64-character alphabet. There's no secret anywhere in that process, so there's nothing for an attacker to guess.

Worked example: a made-up database Secret

Here's an illustrative Secret for a demo app. The username and password are invented for this post:

apiVersion: v1 kind: Secret metadata: name: demo-db type: Opaque data: username: ZGVtby1hcHA= password: Tm90QVJlYWxQYXNzLTIwMjYh 

Step 1: encode. The data field must hold Base64 strings, so the plain values get encoded first:

  • demo-app is 8 bytes. 8 bytes is 2 full groups of 3 plus 2 leftover bytes, so the output has 3 groups × 4 = 12 characters, ending in one =: ZGVtby1hcHA=
  • NotARealPass-2026! is 18 bytes, exactly 6 groups of 3, so it becomes 6 × 4 = 24 characters with no padding: Tm90QVJlYWxQYXNzLTIwMjYh

The general size rule is 4 × ceil(bytes / 3) characters, about 33% bigger than the input.

Step 2: "attack" it. Reading the password back takes one command, and you don't need a key:

echo 'Tm90QVJlYWxQYXNzLTIwMjYh' | base64 -d # NotARealPass-2026! 

The same goes for kubectl get secret demo-db -o jsonpath='{.data.password}' | base64 -d. Anyone who can read the Secret object can read the password. The Kubernetes docs say so directly: the Secrets page warns that Secrets are, by default, stored unencrypted in etcd, and that anyone with API access to a Secret can retrieve it. In its TLS example, it adds that Base64 "obscures" values but doesn't provide "any useful level of confidentiality".

Checked result: I ran these values through three implementations and they all agreed: the encoder's own worker script (the code the page runs) executed in Node, Python's base64 module, and GNU base64. All three encode to the strings above and decode back to the original bytes.

The bug you'll hit first: the invisible newline

This one isn't a security problem, but it breaks more Secrets than any attacker does:

echo 'NotARealPass-2026!' | base64 # Tm90QVJlYWxQYXNzLTIwMjYhCg== echo -n 'NotARealPass-2026!' | base64 # Tm90QVJlYWxQYXNzLTIwMjYh 

Plain echo appends a line feed (byte 0x0A). The input becomes 19 bytes, so the output grows to 28 characters and ends in Cg==. Your app then receives the password plus a newline, and the database login fails even though the Secret "looks right". If an encoded value ends in Cg== or Cg, check for a trailing newline first. Use echo -n or printf '%s', or put plain values in stringData and let Kubernetes do the encoding.

What hashing and encryption look like next to it

Hashing is one-way. SHA-256 of the same made-up password is:

70f8ba0bdf15826c4dca56a9a3e1a33cabc024290e87c2fe37b2d067e57a8eeb 

There's no "decode" for that. A hash is still the wrong tool for a password your app has to send to a database, though, because the app needs the original value.

Encryption is what confidentiality actually needs. In this Node sketch, Base64 is only the wrapper used for transport:

const crypto = require("node:crypto"); const key = crypto.randomBytes(32); // lives in a KMS/vault, never next to the data const iv = crypto.randomBytes(12); // unique per message const cipher = crypto.createCipheriv("aes-256-gcm", key, iv); const ct = Buffer.concat([cipher.update("NotARealPass-2026!", "utf8"), cipher.final()]); const blob = Buffer.concat([iv, cipher.getAuthTag(), ct]); // 12 + 16 + 18 = 46 bytes console.log(blob.toString("base64")); // 64 chars, different on every run 

Decoding that 64-character string gives you 46 random-looking bytes. Without the key, there's nothing useful in them. That's the difference: here Base64 carries the ciphertext, and the encryption is what protects it.

What to actually do with Kubernetes Secrets

The Kubernetes docs list these steps. In my experience they're also where teams fall short:

  1. Turn on encryption at rest for Secrets in etcd (or use a managed cluster that does it with a KMS).
  2. Use least-privilege RBAC. get, list and watch on Secrets amount to "read every password in the namespace".
  3. Limit which containers mount or receive each Secret.
  4. Consider an external secret store (a vault or a cloud secret manager) for anything high-value.

And never paste a Base64 value into chat, a ticket or a log and treat it as hidden.

How to use the tool

  1. Open the Base64 Encoder and make sure Encode to Base64 is selected.
  2. Type or paste a test value into Input String. With Live Conversion on, the Base64 appears right away.
  3. Click Copy, or switch to Decode Base64 to check the round trip.

The conversion runs in your browser. The History panel does keep recent short conversions in your browser's local storage, though, so click Clear History if you've tested anything real. Better still, test with fake values like the ones in this post.

Recap

Base64 changes how bytes are written, not who can read them. Count on it for transport, not for protection: encrypt at rest, lock down RBAC, watch for the trailing-newline bug, and treat any Base64 blob as plain text that just looks unfamiliar.