Vaultools
Menu

Encoding vs encryption

Encoding changes how data is represented so it survives a particular channel, and anyone can reverse it. Encryption hides data so that only someone holding the key can read it. Mistaking one for the other is a common source of leaked secrets.

Encoding: a change of representation

An encoding maps data to a different form so it can travel through a channel that would otherwise mangle it. Base64 turns arbitrary bytes into letters, digits and a few symbols so they fit in email, JSON or an HTTP header. Percent-encoding writes a space as %20 so it can sit inside a URL. HTML entities write < as &lt; so a browser shows it instead of treating it as a tag.

Every one of these is public and keyless. The rules are published in standards, and the same function that encodes can be run backwards by anyone. That is the point: the receiver has to be able to decode without any prior arrangement.

Encryption: hiding data behind a key

Encryption, such as AES or ChaCha20, transforms data so that it can only be turned back into the original by someone holding the right key. Without the key, the output is designed to be indistinguishable from random bytes: no patterns, no recognizable structure, nothing that gives away what went in.

Because encrypted output is binary, it is often then encoded, usually as Base64, so it can be stored as text. That is why a Base64 string can hold something secret. The Base64 layer protects nothing; the encryption underneath does.

Where the two get confused

Telling them apart in practice

If a value decodes to readable text or a known file type, it was only encoded. If it decodes to bytes with no visible structure, it may be encrypted, compressed, a random key or just noise, and the bytes alone cannot say which. The Vaultools Format Identifier follows exactly that rule: it recognizes encodings by their structure, and it says it doesn’t recognize a value rather than guess that it’s encrypted.

References

Ads on this page

Non-personalized ads help keep Vaultools free — Google decides where they appear on the page.

Go Pro to remove them →