I would like to generate SHA1 or similar hashes using only client-side Javascript. In other words, using the Javascript engines provided with IE, FF, and Webkit. I am wondering what hash implementations exist?
I don't believe there are any built directly into the browser, but there are some well-documented implementations.
The best I have found is http://code.google.com/p/crypto-js/ which is available via CDN and supports:
If security matters then use an algorithm that hasn't been broken (yet) and is less subject to various forms of attack (wikipedia has a nice breakdown at the bottom of this article).
Based on the lack of answers to this question, it doesn't seem like this is native browser functionality. I wish there was, but I could see issues arising from relying on the browser. For example, if a flaw was discovered in an algorithm, it would be difficult to move your users to a new algorithm until you knew all of their browsers supported it (and they had upgraded). If you control the hashing algorithm, then you can deploy a new script whenever you wish.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With