> I have tried to use crypto++ to get the same result as mcrypt for a
> simple CFB crypto. The reason is I am trying to write a new client for
> an existing server that use mcrypt, and mcrypt is not "easily"
> available for windows.
>
> The result from mcrypt is:
> 0xa7, 0x8f, 0x88, 0x4e, ...
>
> Where-as the result from crypto++ is:
> 0xa7, 0x44, 0x24, 0x6e, ...
>
> As you can see the first byte is the same but the following ones are
> not. I have seen another post on the list regarding a similar issue
> but there was no solution. I am thinking it might be related to some
> issues with block-size or some such but I am not an expert on
> cryptography so I hope that someone here might be able to help me with
> this. I have also tried this with DES/3DES with the exact same result
> (ie. first char correct, the rest are not).
>
> // Michael Medin
FWIW, when I replace your test mcrypt function with a similar function
for OpenSSL:
void testOpenSSL() {
EVP_CIPHER_CTX ctx;
EVP_CIPHER_CTX_init(&ctx);
EVP_CipherInit_ex(&ctx,EVP_aes_256_cfb(),0,key,iv,1);
int ctout = 1024;
unsigned char ciphertext[ctout];
EVP_CipherUpdate(&ctx,ciphertext,&ctout,plain,sizeof(plain));
print_it("openssl ciphertext",ciphertext,ctout);
EVP_CIPHER_CTX_cleanup(&ctx);
}
OpenSSL gives the same results as crypto++. So I suspect your problem
is either misuse of libmcrypt or a bug in libmcrypt. I haven't really
used that library, so I couldn't say. Is there an mcrypt mailing list?
HTH,
Geoff
--~--~---------~--~----~------------~-------~--~----~
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.
-~----------~----~----~----~------~----~------~--~---