Newbie help - password hash
Brad Hards
bradh at frogmouth.net
Mon Sep 14 12:21:00 CEST 2009
On Monday 14 September 2009 04:52:42 cc10 wrote:
> char userPass[16]; // password of the user (string)
> scanf("%s", &userPass);
Nothing to do with gcrypt, but what do you think will happen if the user
writes more than about 16 characters here?
> char userPassHash[16]; // hash of the password
> gcry_md_hash_buffer(1, userPassHash, userPass, strlen(userPass));
You didn't post most of your code, so it is a bit difficult to know, but did you
remember to initialize the library?
If so, can you post a minimal compilable example that shows the problem?
Brad
More information about the Gcrypt-devel
mailing list