Hash encryption and salting in c++

Hi all, can i ask how can i get started with encryption and salting using c++
i got the basic program written out, which is the written the username and password to a text file. My question is how do i encryption the password with a salt using c++? Is there a library i can use?
Thanks in advance
Usually passwords are not encrypted. Instead they are hashed and only the hash value is stored. This makes it much harder to get back the real password because there is no simple way to convert the hash back to the original password.

You can use SHA-1 or some other secure hash algorithm. It is probably not very hard to implement SHA-1 yourself. Wikipedia has pseudocode that you can follow: http://en.wikipedia.org/wiki/SHA-1#SHA-1_pseudocode
You could also use a library of course.
Last edited on
haha i see. Thanks alot
May i know which library is to be used, if i don`t want to implement the SHA1
I have never used any hash libraries in C++ so I don't know.
Crypto++ looks good. It has a class named SHA1 that you could use.
I also found this small library http://www.packetizer.com/security/sha1/
oh okay! sure thing, thanks alot!
Topic archived. No new replies allowed.