GreenRover
GreenRover

Reputation: 123

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.

Upvotes: 0

Views: 1098

Answers (1)

user734976
user734976

Reputation:

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:

htt­p://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.

Upvotes: 1

Related Questions