如果可以轻松解码,为什么要用 base64 编码字符串

Why encode string with base64 if it can be easily decoded

有一些编码器算法无法破解,这些编码器用于 HTTPS 等应用程序,用于通过网络发送安全消息。 base64很简单,很容易解码,我觉得用base64编码就像发送原始数据一样简单。 那为什么要用base64编码呢?例如 Elasticsearch 自动生成使用 base64

编码的 id

Base64 根本不用于安全性,它用作转义特殊字符的手段。

参见:

https://security.stackexchange.com/questions/29916/why-does-http-basic-authentication-encode-the-username-and-password-with-base64

Why Base64 in Basic Authentication