I'm recieving two strings: the username and the password, based on which, I'm retrieving and instance of AspNetUser, which has the corresponding fields. I want to produce the corresponding Id but only if the name and pass check out. The former is simple because it's in plain text.
How can I, given the provided password, verify that the hash value is correct?
I have looked at the code in the default template for a few hours but I can't get my head around it. Based on this page, I've created my own HASHes but the one I'm getting differs from the on in the DB, so I'm guessing that I'm doing it wrong or that they are adding some magic part before hashing it.
My: E8B9C259EAB04BBB67B2D67AF5745B
DB: AFczTgO67ViTWwZNejEiTyKRg5s96x5mOmwFFBj7yRUpys/5duOw0q6I6imCm1t1hQ==
See above, can you spot the difference...? The password used is "Abc123()", in case it matters.
Am I barking up the wrong tree when I try to use MD5CryptoServiceProvider? Is there a default string that's being jacked into the source before the hash's being computed?
If there are comments regarding the best practices, I'm open to them, of course. Bear in mind, however, that the security issues being my weak point, have bothered me for a long time so this is the way I want to go to understand the concept, down to bits and bolts. If possible, that is.
I can optionally use the facility that MS provided for me but I haven't got that right yet, neither. It appears to me like a lot of code doing "something here, something there".
<system.web>
<membership defaultProvider="donkey">
<providers >
<clear/>
<add name="donkey" passwordFormat="Hashed" />
</providers>
</membership>
<authentication mode="None" />
<compilation debug="true" targetFramework="4.5.2" />
<customErrors mode="Off"></customErrors>
<httpRuntime targetFramework="4.5.2" />
</system.web>