S
S
Sergey Kulikov2016-01-25 10:41:32
PHP
Sergey Kulikov, 2016-01-25 10:41:32

How to check Membership password from ASP.NET in PHP site?

I have an ASP.NET MVC 3 site and it needs to be rewritten in PHP. Authorization on the site is done using the ASP.NET Membership class. The ASP application config contains passwordFormat="Encrypted". For a long time I tried to find information on the Internet how this method of storing a password works, but basically everywhere it is written about the Hashed format. I found one site that described the password encryption algorithm. It says that a salt is added to the password, then it is encrypted (because the decryption method is not specified, as I understand it is AES by default). But after trying to decrypt it with the function

function decodePassword($encrypted_pass, $decr_key){
  $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_192, MCRYPT_MODE_CBC);
  $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
  return mcrypt_decrypt(MCRYPT_RIJNDAEL_192, $decr_key, base64_decode($encrypted_pass), MCRYPT_MODE_CBC, $iv);
}

it should turn out Password + Salt, but instead it turns out incomprehensible crap. Who knows, maybe there are some ready-made libraries for these purposes? Or where did I make a mistake when writing the function?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2016-01-25
@VladimirAndreev

try without IV

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question