Basic authentication is convenient and flexible but completely insecure. Usernames and passwords are sent in the clear, and there is no attempt to protect messages from tampering. The only way to use basic authentication securely is to use it in conjunction with SSL.
Digest authentication was developed as a compatible, more secure alternative to basic authentication. We devote this chapter to the theory and practice of digest authentication. Even though digest authentication is not yet in wide use, the concepts still are important for anyone implementing secure transactions.
 Usernames and passwords are scrambled using a trivial base-64 encoding, which can be decoded easily. This protects against unintentional accidental viewing but offers no protection against malicious parties.