Moran Talmon
Moran Talmon

Reputation: 595

Is there a way to compare the old password if it's hashed?

I am using the ChangePassword web control in order to change the user password. my provider is using hashed password, and I am want to keep using it. just wanted to know if there is a way to compare the current password the user entered with the old password in the DB.

Upvotes: 1

Views: 944

Answers (2)

derSteve
derSteve

Reputation: 751

You can use Membership.ValidateUser method, that returns true or false, depending on whether the entered password - in your case the new password - is the same as the old password.

http://msdn.microsoft.com/en-us/library/system.web.security.membership.validateuser.aspx

Upvotes: 2

Parv Sharma
Parv Sharma

Reputation: 12705

hash the current password and compare it.. thats how it is ususally done

Upvotes: 0

Related Questions