Thanks for the reply, Wei.
I thought that I was hex encoding the cipher text. Perhaps you can help
me debug my code that uses Crypto++ 5.1.
I am using the following code to encrypt the clear text:
char clear[100];
Basic_string challenge;
Basic_string m_password;
CryptoPP::DefaultEncryptorWithMAC encryptor(m_password.c_str(),
new
CryptoPP::HexEncoder());
encryptor.Detach( new CryptoPP::StringSink( challenge ));
encryptor.Put( ( byte const * ) clear, strlen( clear ));
encryptor.MessageEnd();
Shouldn't this code be hex encoding ? Thanks for your help.
John
-----Original Message-----
From: Wei Dai [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 02, 2004 12:54 AM
To: [EMAIL PROTECTED]
Subject: Re: Compatibility of Crypto++ 3.2 with Crypto++ 5.1
They should be compatible, and "|" can be part of the ciphertext for
Crypto++ 3.2 also. You need to hex or base64 encode the ciphertext if
Crypto++ you
want to use "|" as a delimiter.
On Mon, Nov 01, 2004 at 11:23:57AM -0500, John Bradley wrote:
>
> I have a newbie question about Crypto++. I am porting some libraries
> from Microsoft Visual Studio 6 to Visual Studio .NET 2003. Part of
> this porting effort is migrating from Crypto++ 3.2 to Crypto++ 5.1. We
> use
> Crypto++ to perform validation of username and password between our
> client and server. The client uses DefaultEncryptorWithMAC to encrypt
> the username, timestamp and some random data using the password as the
> key. The server uses DefaultDecryptorWithMAC to decrypt the cipher
> text. The initial phase of this porting effort will have the client
> using
> Crypto++ 5.1 and the server using Crypto++ 3.1.
>
> I've noticed an incompatibility in the cipher text generated by
> DefaultEncryptorWithMAC in Crypto++ 5.1. We take the cipher text
> generated by DefaultEncryptorWithMAC and we put it in a message in
> which each field is delimited by a "|" character. This works with
> Crypto++ 3.2. It doesn't work with Crypto++ 5.1, because the "|"
> character can be part of the cipher text in Crypto++ 5.1.
>
> This problem leads me to ask whether text encrypted with
> DefaultEncryptorWithMAC in Crypto++ 3.2 can be decrypted using
> DefaultDecryptorWithMAC in Crypto++ 5.1 ? If the two versions of
> Crypto++ are not compatible by default, then is there a way of making
> them compatible ?
>
> Thanks for your help.
>
> John
>
> ----------------------------------------------
> John Bradley
> Software Development
> Lava Trading Inc.
> 95 Morton Street, 4th Floor
> New York, NY 10014
> Tel: 212.609.0162
> Fax: 212.609.0101
> www.lavatrading.com <http://www.lavatrading.com/>
> This communication (including attachments) contains information that
may
> be confidential. It is for the exclusive use of the intended
> recipient(s). If you are not the intended recipient(s), please note
that
> any distribution, copying or use of this communication or the
> information in it (including, in any attachments) is strictly
> prohibited. If you have received this communication in error please
> notify us by e-mail or by telephone 212-609-0162 and then delete the
> e-mail and all attachments and any copies thereof.
>
>