Newbie help - password hash

cc10 tsubidio at gmail.com
Sun Sep 13 20:52:42 CEST 2009


Hi,

I am very new to libgcrypt. I am trying to write a simple system, where a
user in order to login needs a password. I'd like to store this password
hashed in md5 on the computer. This is what I did so far:

char userPass[16]; // password of the user (string)
scanf("%s", &userPass);

char userPassHash[16]; // hash of the password
gcry_md_hash_buffer(1, userPassHash, userPass, strlen(userPass));

I was hoping that userPassHash would give me the hash of the password (which
I then convert to hex for storage), but it is not the case. I am sure I am
doing something stupid (my guess is that I cannot use the string as an input
in the hash function, but I am not sure what type of input it needs to be).
Can anyone help?

Thank you,
Charles
-- 
View this message in context: http://www.nabble.com/Newbie-help---password-hash-tp25425990p25425990.html
Sent from the GnuPG - Libgcrypt - Dev mailing list archive at Nabble.com.




More information about the Gcrypt-devel mailing list