Base64

A way to write any bytes using only 64 safe text characters, so binary data can travel in places that expect text.

In more detail

Encoding is not encryption: anyone can decode Base64, so it hides nothing and needs no key. Basic authentication uses standard Base64, and JSON Web Tokens use the URL-safe variant, base64url, for their three parts.

Examples

printf '%s' "$secret" | base64
base64.b64decode("c3ZjLXJlcG9ydDpub3QtYS1yZWFsLXBhc3N3b3Jk")   # b'svc-report:not-a-real-password'
echo -n hello | base64   # aGVsbG8=
In the browser: Base64 is an encoding, not encryption: anyone can decode it.

Related terms

Taught in

References

Certification courses