in reply to convert dotnet to perl

Essentially, an 8 byte array can be manipulated in Perl as a string with 8 characters, though there might but some unicode related concerns.

You're going to have to be a little clearer about what you are having problems with?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco.
Rule 1 has a caveat! -- Who broke the cabal?

Replies are listed 'Best First'.
Re^2: convert dotnet to perl
by Anonymous Monk on Apr 21, 2005 at 18:54 UTC
    Well, the class they are using seems to be based on DES. I was planning on using Crypt::DES but I don't see any methods that allow passing in an IV. So, the next thing I did was take a look at Crypt::CBC which allows you to specify a cipher (DES, in this case) as well as a key and iv. My next problem was trying to figure out what to do with a dotnet byte array for the iv and key (pack?) in order to stringify since that is what the perl modules use.

      Where are you getting these fields from in your Perl code? And what form are they in?


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco.
      Rule 1 has a caveat! -- Who broke the cabal?
        I'm not sure I understand your question. The initialization vector and key are from the dotnet code and looks like this:

        private static byte InitVect = { 11, 22, 33, 44, 55, 66, 77, 88}; private static byte CryptKey = { 99, 100, 101, 102, 103, 104, 105, 106 };

        (numbers changed for security)

        I tried doing a pack("b*",(11, 22, 33, 44, 55, 66, 77, 88)) but I'm not sure if that is what I need to do.

        Anybody know what I need to do with these?