base 64 编码的目的是什么以及为什么在 HTTP 基本身份验证中使用它? [英] What is the purpose of base 64 encoding and why it used in HTTP Basic Authentication?

查看:20
本文介绍了base 64 编码的目的是什么以及为什么在 HTTP 基本身份验证中使用它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有得到 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 的字符.

While encoding the user name and password with the Base64 algorithm typically makes them unreadable by the naked eye, they are as easily decoded as they are encoded. Security is not the intent of the encoding step. Rather, the intent of the encoding is to encode non-HTTP-compatible characters that may be in the user name or password into those that are HTTP-compatible.

这篇关于base 64 编码的目的是什么以及为什么在 HTTP 基本身份验证中使用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆