Platform: ASP.NET
Architecture: N-Tier
Language: C#
Project Type: Web Application
Backend: SQL Sever 2000
I've traditionally used Salt + SHA1 Hash authentication but a question came up the other day that I hadn't thought of. Because we don't use SSL (clients dont support it), all passwords are being sent from the client in plain text. So even with all the security setup server side, someone can easily just sniff the packets coming from the client and gain access through that user's credentials.
I'm proposing the following solution and am wondering what other developers (Yes, you, UCJefe) think:
Have the database have the following fields:
SHA1Hash UserName
SHA1Hash Password
VarChar ServerSalt
VarChar ClientSalt
At the login page, the server would grab the clientsalt value and pass it to the client in a hidden form variable. The client javascript function would run an MD5 hash on the username and password using the salt value. It would pass this hash (h1) to the server.
The server would then take h1 and run a SHA1 hash with salt (using a different salt value??ServerSalt?) on it to get another hash (h2). This is the hash it would use to store/compare in the database.
This allows us to avoid passing plaintext passwords and yet doesn?t compromise security with plaintext passwords in the database. A dictionary attack using sniffed salt values from the client (and a good guess that we?re using MD5) would be much more difficult as the attacker would have to run his dictionary through the salt-hash and then compare each output value to the hash being sent to the server. We could also randomly generate a new client salt every time a user logs in so that the same hash would only work once.
And if an attacker from the inside decided to run a dictionary attack on the database, he?d first have to hash each common plaintext password with the client side salt, and then hash it again with the serverside salt. It would take too long to run that procedure on a huge list, and the chances of getting lucky with an administrator account are not very likely.
Does this make sense? Can anyone poke holes in my logic?
Architecture: N-Tier
Language: C#
Project Type: Web Application
Backend: SQL Sever 2000
I've traditionally used Salt + SHA1 Hash authentication but a question came up the other day that I hadn't thought of. Because we don't use SSL (clients dont support it), all passwords are being sent from the client in plain text. So even with all the security setup server side, someone can easily just sniff the packets coming from the client and gain access through that user's credentials.
I'm proposing the following solution and am wondering what other developers (Yes, you, UCJefe) think:
Have the database have the following fields:
SHA1Hash UserName
SHA1Hash Password
VarChar ServerSalt
VarChar ClientSalt
At the login page, the server would grab the clientsalt value and pass it to the client in a hidden form variable. The client javascript function would run an MD5 hash on the username and password using the salt value. It would pass this hash (h1) to the server.
The server would then take h1 and run a SHA1 hash with salt (using a different salt value??ServerSalt?) on it to get another hash (h2). This is the hash it would use to store/compare in the database.
This allows us to avoid passing plaintext passwords and yet doesn?t compromise security with plaintext passwords in the database. A dictionary attack using sniffed salt values from the client (and a good guess that we?re using MD5) would be much more difficult as the attacker would have to run his dictionary through the salt-hash and then compare each output value to the hash being sent to the server. We could also randomly generate a new client salt every time a user logs in so that the same hash would only work once.
And if an attacker from the inside decided to run a dictionary attack on the database, he?d first have to hash each common plaintext password with the client side salt, and then hash it again with the serverside salt. It would take too long to run that procedure on a huge list, and the chances of getting lucky with an administrator account are not very likely.
Does this make sense? Can anyone poke holes in my logic?