Couple of questions re: attributes
"Timothy J. Miller" <[email protected]>
| Newsgroups | gmane.comp.encryption.cryptlib |
|---|---|
| Message-ID | <[email protected]> |
OK, I'm new at cryptlib, so bear with me. First: When setting a salt on a context, what is expected in the string? I.e., in the Python bindings if I do: cryptSetAttributeString(context, CRYPT_CTXINFO_KEYING_SALT, salt) When salt is a packed string (i.e., bytestring) or an arbitrary string, I get a bad argument error. *Some* uppercase hex strings are accepted, some aren't (e.g., '7D60435F02E9E0AE' works, '1234567890ABCDEF' doesn't). What's the criteria and is this documented somewhere? I can't find a mention in the docs. Second: When setting a password on a context I'm getting an internal consistency check raised. Clearly I'm in the wrong here, but it looks right to me. E.g. (again in Python): >>> from cryptlib_py import * >>> salt = '7D60435F02E9E0AE' >>> ctx = cryptCreateContext(CRYPT_UNUSED, CRYPT_ALGO_DES) >>> cryptSetAttribute(ctx, CRYPT_CTXINFO_KEYSIZE, 8) >>> cryptSetAttribute(ctx, CRYPY_KEYING_ITERATIONS, 800) >>> cryptSetAttributeString(ctx, CRYPT_CTXINFO_KEYING_SALT, salt) >>> cryptSetAttributeString(ctx, CRYPT_CTXINFO_KEYING_VALUE, 'password') Traceback (most recent call last): File "<stdin>", line 1, in <module> cryptlib_py.CryptException: (-16, 'Internal consistency check failed') Interestingly, other values of the password value can yield a bad argument error. E.g.: >>> cryptSetAttributeString(ctx, CRYPT_CTXINFO_KEYING_VALUE, 'Cv(G%$Va') Traceback (most recent call last): File "<stdin>", line 1, in <module> cryptlib_py.CryptException: (-3, 'Bad argument, parameter 3') Any help is always appreciated. (FWIW all I'm doing is trying to validate some test vectors as a way to familiarize myself with cryptlib. Real work comes later. ;) -- Tim _______________________________________________ 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.
smime.p7s
(application/x-pkcs7-signature, 3.4 KB) - not displayed