Re: Problem Decrypting Data

GMX <[email protected]>
Newsgroups gmane.comp.encryption.cryptlib
Message-ID <[email protected]>
> The one part I am not following to the letter is that I am calling the
> cryptSetAttribute methods *before* I call cryptPushData.
> 
> But when I reverse those two calls, I get an error (and not the expected
> error telling me I need a password, rather error -21 (No Permission to
> Perform this Operation.))
> 
> Any help would be greatly appreciated.

When calling crypt.CreateEnvelope(crypt.UNUSED,crypt.FORMAT_CRYPTLIB)
you try to encrypt and NOT to decrypt the message! That's why you get an
error -21 when you reverse your callind sequence.
You have to use crypt.FORMAT_AUTO as second parameter for decryption.

Using envelopedData.Length as length of your messageBuffer is not
the optimal solution: In case of an encrypted envelope the decrypted
length is always shorter than the envelope length, but when you try
to de-envelope a compressed envelope, you may get a longer byte
string on PopData than you pushed in.

Wolfgang Gothier


_______________________________________________
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.