HTTP Basic Auth 中的 Base 64 编码 [英] Base 64 encoding in HTTP Basic Auth

查看:31
本文介绍了HTTP Basic Auth 中的 Base 64 编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道编码字符串的目的是什么:登录:密码"使用 HTTP 基本身份验证时在 base 64 中.

I am wondering what is the purpose of encoding the String: "login:password" in base 64 when using HTTP Basic Auth.

  • Base 64 通常用于通过纯 ASCII 协议发送二进制数据.但是 login:password 已经是一个字符串了
  • 它几乎没有增加任何安全性
  • 输出比输入长,因此不会提高性能

我可能遗漏了一些东西,因为在我看来,这种编码只是增加了不必要的复杂层.

I am probably missing something since it does currently seems to me that this encoding just adds an unneeded layer of complexity.

谢谢

推荐答案

来自 http://en.wikipedia.org/wiki/Basic_access_authentication

安全不是编码步骤.而是本意编码是编码不兼容 HTTP 的字符可能在用户名或密码中到那些与 HTTP 兼容的.

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.

这篇关于HTTP Basic Auth 中的 Base 64 编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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