in reply to decrypting .net RijndaelManaged with perl

I had a similar problem with Twofish about a decade ago. The biggest problem was that there was a definite difference in implementation, basically like starting with different IVs or maybe endian problems on different platforms. My solution was to get the C++ code and code up an exact workalike XS (Crypt::Twofish). You may need to do the same; look at RijndaelManaged's source (C#?) and get the constants it uses, then see if you can make your own private version of Crypt::Rijndael which handles it. A pure perl version would be fine too, although slow, if you're willing to take the time to decrypt legacy encrypted data, but that wouldn't work for production environment code.

HTH,
SSF

  • Comment on Re: decrypting .net RijndaelManaged with perl

Replies are listed 'Best First'.
Re^2: decrypting .net RijndaelManaged with perl
by ikegami (Patriarch) on Jun 02, 2009 at 05:04 UTC
    Or write a small encrypter/decrypter in C# and run it as a child (IPC::Open2)
      That is an interesting idea, I'll have to look into it.
Re^2: decrypting .net RijndaelManaged with perl
by rpadmin (Initiate) on Jun 02, 2009 at 11:03 UTC
    I had a feeling that was what I had to do.

    Yes, it is a C# class being used and with a breif look at teh source it looks like a byte_array (byte[]) for the key and iv are being used.

    Is there are striaght forward way in perl (short of doing a bit by bit translation) to convert into a byte_array?

    Maybe pack / unpack?