C#RijndaelEnhanced用php mcrypt解密

时间:2011-05-02 12:34:07

标签: c# php rijndael

我有一个C#.net应用程序,我反编译。 Tis app用于登录密码加密: http://www.obviex.com/samples/Sample.aspx?Source=EncryptionWithSaltCS&Title=Encryption%20With%20Salt&Lang=C%23

C#代码

rijndaelKey = new Krypto.RijndaelEnhanced(passPhrase, initVector);
PlainPassword = DiverseVariablen.rijndaelKey.Decrypt(Conversions.ToString(row["ProjectKennwort"])))

我已通过并且iv。

我如何在php中解密密码? 我已经尝试了几种mcrypt_decrypt()变体。

Didt somene有想法吗?

友好的问候和非常感谢。

1 个答案:

答案 0 :(得分:1)

看起来他们正在使用password-based key derivation function。 mycrypt允许您直接设置密钥,并在适当时使用null填充它。您链接的C#库从密钥中获取密码。 Google搜索PBKDF2 PHP会发现以下内容:

http://www.itnewb.com/v/Encrypting-Passwords-with-PHP-for-Storage-Using-the-RSA-PBKDF2-Standard

所以我试试。另外,我个人建议使用phpseclib, a pure PHP AES implementation来实现可移植性。 PHP安装在服务器上并不意味着mcrypt是。