How to check if question and password in ASP.NET membership is correct or not without using password

I have an ASP.net membership. I need to check a Custom question and answer.

I do not need to use a password because it Hashed we cannot verify it

MembershipUser msUser = Membership.GetUser ("Rasel");

thanks, Lalithambigai

+1


source to share


2 answers


Ask the user a question and compare your answer with the previously provided answer?



However, the hashed password does not prevent you from verifying it. Just hash the user's response and compare the hash to the stored password hash. Note that the hashing scheme can contain salts or initialization characters to prevent dictionary attacks.

+2


source


If you store the question / answer in the membership provider (how it looks like you do), you are passing the response to the msUser.ResetPassword method. If the answer is incorrect, it will throw a MemberhipPasswordException.



0


source







All Articles