通过移动网站的 https (SSL) 连接传递 base64 编码的用户名和密码
通过移动网站的安全 SSL 连接将 Base64 编码的用户名和密码作为变量传递是否安全?
我是否应该使用 AES256 对其进行编码?
对于每个网页,我都会获取带有 Base64 编码的用户名和密码的网址,如下所示
https://mobile.site.com?id =ASDQWEQWEQWEQWEQWE(其中 id 包含用户名和密码)
Whether passing a base64 encoded username and passwords as variables through a secured SSL connection for a mobile website is safe?
Whether I should encode it with AES256?
For eachwebpage I fetch a url with base64 encoded username and password like this
https://mobile.site.com?id=ASDQWEQWEQWEQWEQWE (Where id contains username and password)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SSL 是可行的方法,它将加密发送数据,因此流中的任何人都无法读取它。预先使用 AES 对其进行加密需要您预先与客户端和服务器交换密钥,这将是您需要在渠道外执行的一个附加步骤; SSL 中完成的密钥交换的非对称性质使得这一点变得不必要。
并且......不要在客户端散列密码,而只是发送到服务器进行比较。这是一种可怕的做法。如果您的服务器的用户名/密码表被泄露,攻击者将确切地知道向您的服务器发送什么内容以任何用户身份登录(用户 A 具有哈希值 X,因此只需将 A/X 作为 UN/PW 发送,服务器就会让你进来)。您想将实际密码发送到服务器,因此它可以在那里对其进行散列,然后将结果与存储的值进行比较(用户 A 具有散列 X,但我无法弄清楚什么值散列到 X,所以我不知道什么作为 PW 发送)。
SSL is the way to go and will send that data encrypted, so it cannot be read by anyone along the stream. Encrypting it beforehand using AES would require you to pre-exchange keys with both your client and your server, which would be an added step that you would need to do out-of-channel; the asymmetric nature of the key exchange done in SSL makes this unnecessary.
And...do NOT hash the password on the client side and just send to the server to compare. This is a horrible practice. If your server's username/password table were to be compromised, an attacker would know exactly what to send to your server to log in as any user (user A has hash X, so just send A/X as UN/PW and the server will let you in). You want to send the actual password to the server, so it can hash it there and then compare the result to the stored value (user A has hash X, but I cannot figure out what value hashes to X so I don't know what to send as the PW).
如果您使用 SSL 进行连接,则所有内容(包括密码和用户名)都已编码。
不一定使用 AES256,但这取决于所使用的密码套件。
无需额外对它们进行编码,使用 SSL 就可以了。
使用 Base64 对其进行编码是可选的 - 这是一种透明的编码,不会增加任何额外的安全性,它只是为了更轻松地传输数据(例如用户名或密码中的特殊字符)。
If you use SSL to connect then all the content, including passwords and usernames is already encoded.
Not necessarily with AES256, but that depends on the cipher suite used.
There is no need to additionally encode them, using SSL is perfectly fine.
Encoding it with Base64 is optional - it's a transparent encoding that does not add any additional security, it's just meant for easier data transmission (e.g. special characters in usernames or passwords).