问题描述
我没有得到 Base64 加密.
I don't get the Base64 encryption.
如果可以解密 Base64 字符串,它的目的是什么?
If one can decrypt a Base64 string, what is it's purpose?
为什么它被用于 HTTP 基本身份验证?
Why is it being used for HTTP Basic auth?
这就像告诉某人我的密码被反转为 OLLEH.
It's like telling to someone my password is reversed into OLLEH.
看到 OLLEH 的人会知道原来的密码是 HELLO.
People seeing OLLEH will know the original password was HELLO.
推荐答案
Base64 不是加密——它是一种编码.这是一种仅使用可打印(文本)字符来表示二进制数据的方法.
Base64 is not encryption -- it's an encoding. It's a way of representing binary data using only printable (text) characters.
请参阅 wikipedia page for HTTP Basic Authentication 中的这一段:
See this paragraph from the wikipedia page for HTTP Basic Authentication:
虽然使用 Base64 算法对用户名和密码进行编码通常会使它们肉眼无法读取,但它们的解码与编码一样容易.安全性不是编码步骤的目的.相反,编码的目的是将用户名或密码中可能存在的不兼容 HTTP 的字符编码为兼容 HTTP 的字符.
这篇关于base 64 编码的目的是什么以及为什么在 HTTP 基本身份验证中使用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!