简体   繁体   English

C# Rijndael 使用 php mcrypt 增强解密

[英]C# RijndaelEnhanced decrypt with php mcrypt

i have a C# .net app with i decompiled.我有一个反编译的 C# .net 应用程序。 Tis app uses for login password cryption: http://www.obviex.com/samples/Sample.aspx?Source=EncryptionWithSaltCS&Title=Encryption%20With%20Salt&Lang=C%23 Tis 应用程序用于登录密码加密: http://www.obviex.com/samples/Sample.aspx?Source=EncryptionWithSaltCS&Title=Encryption%20With%20Salt&Lang=C%23

C# Code C#代码

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

I have pass and iv.我有通行证和四。

How can i decrypt the passwords in php?如何解密 php 中的密码? I tryted allready several variants of mcrypt_decrypt().我已经尝试了 mcrypt_decrypt() 的几种变体。

Didt somene have a idea?有人有想法吗?

Friendly regards and big thanks.友好的问候和非常感谢。

It looks like they're using a password-based key derivation function .看起来他们正在使用基于密码的密钥派生 function mycrypt gives you set the key directly and null pads it if appropriate. mycrypt 让您直接设置密钥,null 会在适当时填充它。 The C# library you've linked to derives a password from the key.您链接到的 C# 库从密钥派生密码。 A Google search for PBKDF2 PHP reveals the following:对 PBKDF2 PHP 的 Google 搜索显示以下内容:

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

So I'd try that.所以我会尝试。 Also, I'd, personally, recommend using phpseclib, a pure PHP AES implementation , for portability.另外,我个人建议使用phpseclib,一个纯 PHP AES 实现,以实现可移植性。 That PHP is installed on a server doesn't mean that mcrypt is. PHP 安装在服务器上并不意味着 mcrypt 是。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM