Encoding Is Not Encryption
A frequent and costly mistake: treating encoding as protection. Base64, URL encoding and hex only change the format of data so it travels safely; they use no secret, and anyone can reverse them in one line. Seeing a string like cGFzc3dvcmQ= in a config file means the password is effectively in plain sight.
| Idea | Purpose | Needs a key? | Reversible by anyone? |
|---|---|---|---|
| Encoding | Format data | No | Yes |
| Hashing | Fingerprint | No | No (one way) |
| Encryption | Secrecy | Yes | Only with the key |
Examplepython
Quick check
Is Base64 a way to keep a password secret?
Your turn: write the code
Decode this Base64 value and print the text: c2VjdXJpdHkgaXMgZXZlcnlvbmUncyBqb2I=
Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.
Tip: use the left and right arrow keys to move between lessons.