Are there any SHA-256 javascript implementations that are generally considered trustworthy? [closed]

OUTDATED: Many modern browsers now have first-class support for crypto operations. See Vitaly Zdanevich’s answer below.


The Stanford JS Crypto Library contains an implementation of SHA-256. While crypto in JS isn’t really as well-vetted an endeavor as other implementation platforms, this one is at least partially developed by, and to a certain extent sponsored by, Dan Boneh, who is a well-established and trusted name in cryptography, and means that the project has some oversight by someone who actually knows what he’s doing. The project is also supported by the NSF.

It’s worth pointing out, however…
… that if you hash the password client-side before submitting it, then the hash is the password, and the original password becomes irrelevant. An attacker needs only to intercept the hash in order to impersonate the user, and if that hash is stored unmodified on the server, then the server is storing the true password (the hash) in plain-text.

So your security is now worse because you decided add your own improvements to what was previously a trusted scheme.

Leave a Comment