Reputation: 2784
Recently I came across a project which uses MD5 hashing for posting username and password while logging in.. But what I saw was a little weird, they have used both Applet as well as JavaScript for hashing, like if Applet is not there, then JavaScript works.
The code is as follows:
var username=document.getElementById('username');
var password=document.getElementById('password');
try {
encUsername = appletObject.encryptMessage(username);
encPassword = appletObject.encryptMessage(password);
} catch (e) {
encUsername = hex_md5(username);
encPassword = hex_md5(password);
}
//post encUsername & encPassword for validation
Upvotes: 0
Views: 393
Reputation: 2294
Hashing a password and username(?) on the client side serves no security purpose. The biggest benefit of storing hashed passwords on the server, is that in case the password database is compromised, no actual valid passwords are leaked. However, when passwords are hashed on the client side, the hash is in effect a password -- a password that is stored in the clear on the server, and as such provides no security advantage.
Regarding using an applet, I am not sure what the implementation of the applet is, but it does not seem to provide any additional benefit to using the built-in function.
Upvotes: 2