Re: Decrypting openpgp data created by gpg

Peter Gutmann <[email protected]> Sat, 23 Feb 2013 01:08:17 +1300
Newsgroups gmane.comp.encryption.cryptlib
Message-ID <[email protected]>
Lahiru Dissanayake <[email protected]> writes:

>1. To specify cast5 encryption, I tried using the line: cryptSetAttribute(
>cryptEnvelope, CRYPT_OPTION_ENCR_ALGO, CRYPT_ALGO_CAST ); right after
>creating a new envelop, but it returns CRYPT_ERROR_PARAM3 as the status. It
>returns CRYPT_OK if I specify it as AES, 3DES, etc.

CAST5 is an oddball algorithm that's only present in cryptlib because for some
weird reason GPG uses it as its default algorithm instead of AES.  You can't
set it as a default algorithm because it's not supported by most standards, so
it couldn't be used if it was set.

>2. To add integrity checking, I tried the line: cryptSetAttribute(
>cryptEnvelope, CRYPT_ENVINFO_INTEGRITY, CRYPT_INTEGRITY_FULL ); which returns
>CRYPT_OK, but when I add that line to my code, I get CRYPT_ERROR_INTERNAL
>when I push data into the envelope.

Can you send me the code that you're using to do this?  This operation is
performed by the self-test code without running into this problem, so I'd have
to see what your code does that's different.

>3. When de-enveloping public key encrypted data, I'd like to specify a
>private key context that I have loaded from a keyset, rather than giving the
>keyset itself. However, when I specify the private key (after getting
>CRYPT_ENVINFO_PRIVATEKEY as a required resource to decrypt the data) as
>cryptSetAttribute( cryptEnvelope, CRYPT_ENVINFO_PRIVATEKEY,
>pgpPrivateKeyContext ); the function returns CRYPT_ERROR_PARAM2 as the
>status. This doesn't happen when I specify the envelope format as
>CRYPT_FORMAT_CRYPTLIB though. Supplying the keyset to the envelop (and later
>supplying the required password) works with both formats.

Can you send me the code and files I'd need to reproduce this?  Again, this is
done by the self-test code so I'd need to see what you're doing.

>4. Is there a way to load an openpgp keyring from a byte array in memory, as
>opposed from a disk file?

No, you need to read it from a file.

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.