Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: (FoxUni) Re: Plaintext passwords?

by no_slogan (Deacon)
on Mar 23, 2002 at 17:12 UTC ( [id://153804]=note: print w/replies, xml ) Need Help??


in reply to Re: Plaintext passwords?
in thread We blame tye.

Having the client hash the password before sending it over the wire is a start, but doesn't help much if the server isn't who the client thinks it is, since the attacker can just play back the password hash at the real server.
That's why HTTP digest authentication includes a variable "nonce" value. The server sends the nonce to the client when it first attempts to access the page. The client calculates the hash of the password and the nonce together, and sends that back to the server. The server verifies that the hash it recieved was calculated with a valid password and a nonce that was actually sent to that client recently.

If someone tries to replay an old password hash, the server won't accept it, because it won't have a valid nonce.

If the nonce used contains some (cryptographic) function of the time and the client's IP, you can avoid the problem of having to have the server remember which nonces are valid.

The problem, of course, is that the server has to have the password in plaintext so it can calculate the hash and see if it matches the one it got from the client.

Replies are listed 'Best First'.
Re(3): Plaintext passwords?
by FoxtrotUniform (Prior) on Mar 25, 2002 at 21:18 UTC

    How about this:

    • Store the hashed password on the server.
    • Hash the password on the client (using Javascript PasswdMD5 or something), then cat on a sufficiently random session ID and hash it again. Send that hash to the server.
    • The server takes the session ID, cats it onto its copy of the hashed password, hashes the result, and compares that hash to the one it got from the client.

    So the server isn't keeping around any plaintext passwords, and the session ID acts as a one-time key to prevent replay attacks. For extra tasty goodness, you can do this through SSL to prevent attackers from sniffing the session ID, although unless they know the original password hash (which, since we're not storing the password in plaintext anywhere, is mildly unlikely) the worst damage they could do with a sniffed session ID is chuck a bogus hash back at the server and give the real user a "sorry, try again" message (if that).

    I'm a bit leery of this system, because it seems too simple. Can you see any problems with it?

    Update: Cacharbe expressed some doubts about the "sufficiently random" session ID. Basically, the idea is that the server picks a random integer (from /dev/random or something similar), keeps a copy, and sends it off to the client. Client hashes their password, cats the session ID onto the password, hashes _that_, and sends it back over the wire. Server cats the (same) session ID onto its hashed password for whoever the client claims to be, hashes it, and checks it against the hash it got back from the client.

    The problem with this (which I only just saw -- augh!) is that the server's still storing information that can be used verbatim to attack a client account. If I can get the hashed password from the server, then I can just connect, get a session ID, and go from there. In short, it isn't really a step up from storing passwords in plaintext on the server. Oh well, back to the drawing board.

    --
    :wq

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://153804]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-03-28 08:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found