« Return to Thread: Converting PHP code to C#?

Re: Converting PHP code to C#?

by Symbian :: Rate this Message:

Reply to Author | View in Thread


mike-22 wrote:
i'm pretty sure the IV mattered in our stuff.

and remember i used CBC i think not EBC, and it worked fine. not sure
if you want to try that and make it work for you or not without any
warnings :)
Ah! We're using EBC, also I realised that I needed to implement the eqivalent of the pack function in PHP which we use, so I finally have the correct (MD5'd both the PHP and C# bits) string going *into* the function.

Now I have to wrestle with the Rijndael class again:(

            Rijndael r = Rijndael.Create();
            r.Mode = CipherMode.ECB;
            r.Padding = PaddingMode.None;
            r.Key = Encoding.ASCII.GetBytes(KEY);
            ICryptoTransform de = r.CreateDecryptor();
            byte[] output = CryptoTransform(input, de);

Sym

 « Return to Thread: Converting PHP code to C#?