简体   繁体   中英

C# RijndaelEnhanced decrypt with php mcrypt

i have a C# .net app with i decompiled. Tis app uses for login password cryption: http://www.obviex.com/samples/Sample.aspx?Source=EncryptionWithSaltCS&Title=Encryption%20With%20Salt&Lang=C%23

C# Code

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? I tryted allready several variants of mcrypt_decrypt().

Didt somene have a idea?

Friendly regards and big thanks.

It looks like they're using a password-based key derivation function . mycrypt gives you set the key directly and null pads it if appropriate. The C# library you've linked to derives a password from the key. A Google search for PBKDF2 PHP reveals the following:

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. That PHP is installed on a server doesn't mean that mcrypt is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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