Mert úgy múködik. A fentebb linkelt wikin is írják.
However, this presents a problem for many (but not all) challenge-response algorithms, which require both the client and the server to have a shared secret. Since the password itself is not stored, a challenge-response algorithm will usually have to use the hash of the password as the secret instead of the password itself. In this case, an intruder can use the actual hash, rather than the password, which makes the stored hashes just as sensitive as the actual passwords. SCRAM is a challenge-response algorithm that avoids this problem.
Az Apache oldaláról (https://httpd.apache.org/docs/2.4/mod/mod_auth_digest.html):
This module implements HTTP Digest Authentication (RFC2617), and provides an alternative to
mod_auth_basic
where the password is not transmitted as cleartext. However, this does not lead to a significant security advantage over basic authentication. On the other hand, the password storage on the server is much less secure with digest authentication than with basic authentication. Therefore, using basic auth and encrypting the whole connection usingmod_ssl
is a much better alternative.
Nem pontosan így működik (nagyon nem), de a logika talán érthető:
- A szerver elküld neked egy egyedi challenge-et, egy random stringet és küldd vissza a hash( challenge + password ) eredményét.
- Te megcsinálod, a neten csak ez a hash megy át amiből a jelszó nem található ki.
- A szerver kap egy bithalmazt, amiről el kell döntenie hogy jó-e. A challenge értékét ismeri, ahogy a hash algoritmust is, de kell neki még a jelszavad is hogy elő tudja állítani az eredményt. Mivel a neten nem megy át a jelszavad még titkosítva sem, ezért helyileg kell tudnia előkotornia.
A SCRAM ezt bonyolítja el egy kissé hogy a jelszó mégse legyen letárolva, de Digest auth az még RFC2617, míg a SCRAM RFC5802, jóval későbbi.