How to send securely passwords via GET/POST?

我怕爱的太早我们不能终老 提交于 2019-12-09 02:16:27

The usual practice is to send your authentication username+password as the Base64 encoded Authorization header.

Base64 encoding is not encryption. You still have to ensure it goes thro SSL/https.

Base64 codec is a means to ensure that endianess and other idiosyncrasies of routers, switches, and other network intermediaries do not transform the password or any binary data to be transported thro the cloud of networks.

The codec works by perceiving a stream of binary data as being a train of individual text characters. But the characters are not 8-bit but 6-bit. The 64 text characters used are the usual A-Z,a,z,0-9,+,/. With A having the value 0 and / having the value 63.

The http authentication header usually has this basic authentication format:

Authorization: Basic base64-encoded-username-password

Where base64-encoded-username-password has the layout username:password passed thro the base64 encoder (which is a Java util class, btw).

http://en.wikipedia.org/wiki/HTTP_header.

http://en.wikipedia.org/wiki/Base_64.

Always send a password using POST. https will ensure it is encrypted whilst being sent.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!