How do I SSHA1 in C/C++?
How do I calculate in C/C++ a salted SHA1 digest of a C-string (in my case a clear-text password)?
I do not want to include some huge library to do that. All I need is an "easy" way to make a salted SHA1 dige开发者_StackOverflowst.
Quick Google search revealed this: http://www.packetizer.com/security/sha1/
Code both C++ and C, with files to include in your project (so no library). Freeware Public License (FPL).
Well, the 'easy' way is to include a pre-built library.
The essence of SHA1 and other digests is that they are not easy to calculate because that would leave them open to simple duplication that would negate their usefulness.
If on Windows, may be simple CryptCreateHash Function will do? By the way, here you can select the algorithm by ALG_ID.
精彩评论