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

查看:14
本文介绍了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.

请参阅 维基百科页面的 HTTP 基本身份验证:

虽然使用 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天全站免登陆