Base64 is Not Encryption: Common Security Misconceptions
One of the most dangerous bugs in junior development is using Base64 for the sake of "hiding" data.
What is Base64?
It is a binary-to-text encoding scheme. It takes binary data and turns it into a string using a set of 64 characters (A-Z, a-z, 0-9, +, /). Its purpose is to allow binary data to be transmitted over protocols that only support text (like Email or JSON).
The Security Trap
Because the resulting string looks like gibberish to a human, it's often mistaken for encryption. However, Base64 is completely reversible without a key.
When to Use It
- Embedding small images in CSS/HTML (Data URIs).
- Sending binary payloads in JSON.
- Passing authentication headers (Basic Auth).