Re: Converting PHP code to C#?

From: Date: Sat, 28 Feb 2009 03:43:42 +0000
Subject: Re: Converting PHP code to C#?
References: 1 2 3 4 5 6 7  Groups: php.general 
Request: Send a blank email to php-general+get-288968@lists.php.net to get a copy of this message
I go the same problem as well, how could I hardcode the iv and key, if iv="abc" and key="123" in C#, what are the iv and key in PHP? Symbian wrote: > > > > 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 > -- View this message in context: http://www.nabble.com/Converting-PHP-code-to-C---tp12541304p22258550.html Sent from the PHP - General mailing list archive at Nabble.com.

« previous php.general (#288968) next »