Re: Encryption Question
- From: "shimmyshack" <matt.farey@xxxxxxxxx>
- Date: 14 Mar 2007 12:49:01 -0700
On 14 Mar, 19:10, "Bart Van der Donck" <b...@xxxxxxxxxx> wrote:
egg...@xxxxxxxxx wrote:
[...]
Correct, right now, I'm saving the password as plain text on the
server.
You shouldn't do that in a robust authentication model.
When the user signs in their password is sha1 hashed by
javascript then sent to the server where the server password is then
sha1 hashed and compared to what the client sent.
SHA-1 is safe, so the transmission should be protected by this measure
(which is probably why you did it). HTTPS wouldn't add much security
here, though it adds a (perceived!) feeling of safety for the user,
which you might also take into account as a valid argument. Your real
weak point is that the password resides in plaintext on the server.
So what your proposing is when the user signs up, hash the password as
usual, but save it in that state to the server.
Exactly - it adds one level of security. And your server program
doesn't need to be bothered with SHA-1 encryptions all the time, which
might become quite CPU-consuming depending on the circumstances.
Then when the user signs in, hash their password, send to the server
and then compare? Wouldn't that be sending the same hash to the server
each time, how's the better then just sending plain text? that is
plain text in essence...
Normal authentication:
- let user type his password, encrypt it
- do something like: login.asp?EncPW=gH4tGhKLNx
- compare gH4tGhKLNx to stored string to find out if authentication
has succeeded
Changing password:
- let user type the current password and his new requested password,
encrypt both
- do something like: getnewpass.asp?
oldEncPW=gH4tGhKLNx&newEncPW=yHjke4c5Wu
- compare oldEncPW to stored string; if it matches, then delete old
string and store the new one
thus the man-in-the-middle would now know the password hash being
stored in the database.
Now he can request to login, and send
sha1( password_hash_he_sniffed + salt)
now despite not knowing the password the attacker gets in from that
point onward.
You cannot securely change a password using irreversible hashes
without asym. enc.
No server encryption or HTTPS is needed in this scenario; it would not
add any additional security. You could use your favourite (one-way!)
encryption technology from javascript only.
Alternatively, you could send plaintext too. Most authentication
models do this, and it's okay, but only as long as the transmission
takes place over HTTPS. In your case, HTTPS has no real effect because
the password is already SHA-1 encrypted.
Hope this helps,
--
Bart
.
- Follow-Ups:
- Re: Encryption Question
- From: Bart Van der Donck
- Re: Encryption Question
- References:
- Encryption Question
- From: eggie5@xxxxxxxxx
- Re: Encryption Question
- From: David Dorward
- Re: Encryption Question
- From: Bart Van der Donck
- Re: Encryption Question
- From: eggie5@xxxxxxxxx
- Re: Encryption Question
- From: Bart Van der Donck
- Encryption Question
- Prev by Date: Re: addition
- Next by Date: Re: Encryption Question
- Previous by thread: Re: Encryption Question
- Next by thread: Re: Encryption Question
- Index(es):
Relevant Pages
|