Re: Couple of questions re: attributes
Peter Gutmann <[email protected]>
| Newsgroups | gmane.comp.encryption.cryptlib |
|---|---|
| Message-ID | <[email protected]> |
"Timothy J. Miller" <[email protected]> writes: >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. At the native API level it should be binary data, however I'm not sure what Python's marshalling does when it passes the data to the native API, perhaps someone else can answer this. >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') Hmm, can you provide details of what gets passed to the native API to trigger this? Or can you build the debug version of the code, which will throw an exception for the check indicating where it's being done? 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.