On 25 Oct 2014, at 2:01 AM, sdjfhas dufh <sdjfhasd...@mail.com> wrote:

> How do I use pbkdf2 in lib nss? It appears to be supported but I can not find 
> a useable example. The api page list functions but I don't know what to do 
> with them 
> https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Reference#PKCS_.235_functions
> 
> I want to supply a password, choose the rounds then generate a specific 
> amount of bytes. Something like the below would work for me but I expect 
> actual usage wouldn't be like that
> 
> char data_out[20];  //I need 20bytes of data from the password
> int rounds = 50000; //1K is too quick these days
> //password is null terminated
> if(pbkdf2(pass, rounds, salt, &data_out, sizeof data_out) != 0) 
> {printf("Error");}
> 
> Can someone give me a useable example?

The NSS abstraction in APR might give you some clues, I struggled figuring out 
the same thing for this code:

http://svn.apache.org/repos/asf/apr/apr/trunk/crypto/apr_crypto_nss.c

Regards,
Graham
—

-- 
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to