Hello,

We could figure it out that we were using NO_PADDING on the encryption side 
using Bouncy Castle. Sorry for the confusion earlier. And as we were using 
PKCS1 padding on crypto++, it is failing. 

But I couldn't figure out how to create a Decryptor object for NO_PADDING 
scheme in crypto++. Can someone please help me with   this ?

Thanks in advance.
Regards
Mehul



-----Original Message-----
From: Jos� Manuel Romero Ximil [mailto:[EMAIL PROTECTED]
Sent: Friday, February 25, 2005 7:43 PM
To: '[email protected]'
Subject: RE: Crypto++ - Bouncy Castle interoperability


first decode base64 and then decrypt


Manuel



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of J Mehta, Mehul
Sent: Friday, February 25, 2005 2:46 AM
To: [email protected]
Subject: RE: Crypto++ - Bouncy Castle interoperability


Hello,

We are using the PKCS#1 padding scheme on both the sides.  The strange thing
is, if we encrypt the data with crypto++, it can be decrypted with Bouncy
Castle library, but the reverse doesn't happen.

The following is the code using crypto++ to decrypt the data, which is
encrypted using Bouncy Castle library. The data gets Base64 encoded before
getting sent.

=========
        FileSource privFile(privFilename, true, new TransparentFilter);
        RSAES<PKCS1v15>::Decryptor priv(privFile);
        string result;
        StringSource(ciphertext, true, new Base64Decoder(new
PK_DecryptorFilter(GlobalRNG(), priv, new StringSink(result))));
=========

Is there anything which needs to be done differently ?

Regards
Mehul

-----Original Message-----
From: Jos� Manuel Romero Ximil [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 24, 2005 8:09 PM
To: '[email protected]'
Subject: RE: Crypto++ - Bouncy Castle interoperability


I think you need to specify the same padding.


Manuel



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of J Mehta, Mehul
Sent: Thursday, February 24, 2005 8:20 AM
To: [email protected]
Subject: Crypto++ - Bouncy Castle interoperability


Hello,

We are using Bouncy Castle library to RSA encrypt a message. But when we try
to decrypt using crypto++, it throws us 'Bad Ciphertext' error. We are using
PKCS1V15 scheme to do the same.

While trying the other way, we are able to decrypt the message, but it
contains junk also with the actual message.

Are there some known incompatibility issues with these two libraries ? Or is
there something we need to pay attention to ?

Thanks in advance.

Regards
Mehul



Reply via email to