Search code examples
c#drupal-7password-hashphpasscryptsharp

Check drupal 7 password to C#


I am using CryptSharp official version for Checking drupal password hash but I am always getting false, Libarary doesn't have any direct documentation for drupal 7 password 7 but it is saying it has drupal 7 support on nuget description.

Using this code

Crypter.CheckPassword(password, hash);

Tested for following password and hash

Crypter.CheckPassword("admin123","$S$DlagvsBQGWTktiD4cAA2IHTLFzQw7pLuH4427TAq9QxK2b3xtJBT");

but result is always false and I am able to login in drupal by same hash


Solution

  • Drupal 7 hashing is fixed in CryptSharp 2.1 and up.