OpenSSL give you this possibility with
Code:
#include <openssl/evp.h>
.
Then you could use the function: PKCS5_PBKDF2_HMAC_SHA1() to hash a pwd:
Code:
SHA256_CTX context;
unsigned char md[SHA256_DIGEST_LENGTH];
SHA256_Iinit(&context);
SHA256_Update(&context, (unsigned char*)input, length);
SHA256_Final(md, &context)
So md will contain the password's hash..
And for the salt:
Code:
#include <openssl/rand.h>
unsigned char salt[A_NUMBER];
int RAND_bytes(salt, A_NUMBER);
where A_NUMBER is a number of your choice