Re: Is deriving a key in a context equivalent to RFC2898 PBKDF2?
Peter Gutmann <[email protected]>
| Newsgroups | gmane.comp.encryption.cryptlib |
|---|---|
| Message-ID | <[email protected]> |
"Timothy J. Miller" <[email protected]> writes: >I.e., if I did: > >data = <some data encrypted under a PBKDF2 derived key> >ctx = cryptCreateContext(CRYPT_UNUSED, CRYPT_ALGO_3DES); >s = cryptSetAttribute(ctx, CRYPT_CTXINFO_IV, iv, sizeof(iv)); >s = cryptSetAttribute(ctx, CRYPT_CTXINFO_KEYING_ITERATIONS, count); >s = cryptSetAttributeString(ctx, CRYPT_CTXINFO_KEYING_SALT, salt, sizeof(salt)); >s = cryptSetAttributeString(ctx, CRYPT_CTXINFO_KEYING_VALUE, password, sizeof(password)); >s = cryptDecrypt(ctx, data, sizeof(data)); > >Do I get the right plaintext? :) Yes, provided the values you're setting are the same as what was set when the data was encrypted, that should give you the correct plaintext. (Note that there's an easier way to do this, just use password-based enveloping and the only thing you need to worry about is the password/key). Peter. _______________________________________________ Cryptlib mailing list [email protected] via Mail: [email protected] Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/ http://news.gmane.org/gmane.comp.encryption.cryptlib Posts from non-subscribed addresses are blocked to prevent spam, please subscribe in order to post messages.