I am wondering what is the purpose of encoding the String: "login:password" in base 64 when using HTTP Basic Auth.
I am probably missing something since it does currently seems to me that this encoding just adds an unneeded layer of complexity.
Thank you
From http://en.wikipedia.org/wiki/Basic_access_authentication
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.
My first thought is that it's encoded in Base64 simply to make it less blatantly obvious that it's actually a username and a password.
Secondly, people can put all sorts of strange characters in their passwords -- encoding it in Base64 puts the data in a format that is less "messy", if you will.
Also, the length of the output in the Base64 string is fairly negligible; a couple extra packets of data isn't going to degrade performance any noticeable amount.
From Wikipedia:
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.
Wikipedia seems to confirm my initial thoughts. Cheers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With