in reply to Encrypting a Message in C# with Rijndael and Decrypting it on Perl

I think you should first decode message, extract salt and iv, and after that provide them to Crypt::CBC->new. Though I'm not sure that schemes used by Crypt::CBC and C# are compatible.

  • Comment on Re: Encrypting a Message in C# with Rijndael and Decrypting it on Perl
  • Download Code

Replies are listed 'Best First'.
Re^2: Encrypting a Message in C# with Rijndael and Decrypting it on Perl
by zeussn (Initiate) on Jul 10, 2009 at 19:43 UTC
    That shouldn't be the problem because if you do the encrypt with the perl function it work whith the decrypt code.

      Have a look onto Crypt::CBC source, particularly onto _generate_iv_and_cipher_from_datastream and _salted_key_and_iv functions. Crypt::CBC doesn't read IV from encrypted data, it computes IV from the salt and passphrase. Note, that C# implementation may use another algorithm to compute encryption key from the salt and passphrase.