
Hi,
On Nov 8, 2007 8:50 AM, Kirit Sælensminde
Mark Wyszomierski wrote:
Hi,
I'm trying to hash a string, something like:
1) Take string (password) from user 2) Hash it 3) Store to disk
I see boost has some hashing features, but am not quite sure how they work. Do they do this type of thing? I'm looking for some really simple hashing, this is just for a simple application.
There is a Boost.Crypto in the vault - http://lists.boost.org/Archives/boost/2007/09/127248.php
We use OpenSSL for this on Windows which I'm pretty sure also works on Unix too.
Don't forget to salt the password before hashing :)
If a simple one way hashing is what you need (just to convert a string to a number with least collisions), consider the hashing function in Glib which is also used in XEmacs. Look for "hash_string" under: http://cvs.xemacs.org/viewcvs.cgi/XEmacs/xemacs/src/symbols.c?rev=1.45.2.1&content-type=text/vnd.viewcvs-markup I have personally used it in developing a parser/compiler for a DMIS language (CNC type machines) build a syntax tree. with best regards, dhruva -- Dhruva Krishnamurthy Contents reflect my personal views only!