Hello all,
I have a doubt concerning the way that PKI encryption is handling
PKCS#7.
Some background is in order.
I am handling an encrypted string that was encrypted with chilkat's
crypto API and trying to decrypt it with cryptopp, but I fail
miserably with an invalid cyphertext exception.
When I got this error, I built two "hello world" apps. Both apps
encrypt and cerypt data.
One thing I notice right away was that the chilkat's encrypted message
was 500 bytes longer than the same message encrypted with cryptopp.
OK. So the message encrypted with cryptopp doesn't "encode" the data
in a PKCS#7 blob, which is a problem for me has the chilkat expects
data in PKCS#7 format.
I've been roaming around examples and source code, but I didn't find
anything that could really help me.
What I am doing in cryptopp is simply
StringSource pubFile(public_key, true, new Base64Decoder);
RSAES_PKCS1v15_Encryptor pub(pubFile);
RandomPool randPool;
randPool.IncorporateEntropy((byte *)"123", strlen("123"));
StringSource(message, true, new PK_EncryptorFilter(randPool,
pub, new HexEncoder(new StringSink(ciphertext))));
and decoding is simply the inverse...
I just load the public/private keys from a string and I don't know if
that's the source of this problem as the certificate has much more
information than just the string with the keys.
For instance, in here I don't even say what's the size of the key.
Does cryptopp infers it?
So my questions are:
1. Where do I fit PKCS#7 in here?
2. What is the difference between encrypting/decrypting with a
certificate or just setting the public/privet keys from a string?
Cheers
--
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at
http://www.cryptopp.com.