Problems with CreateHash and CompareHash

Topics: Cryptography Application Block
May 12, 2009 at 4:03 PM

Good Evening,

I'm using the Enterprise Library for my Assigned Practical Task regarding creating a web-based Knowledge Base system. I'm currently having problems regarding the CreateHash. I am giving CreateHash the hash instance which is SHA256Managed, and the password. During two different runs, the password has two different hash values, therefore they do not match.

Another problem is with the CompareHash. As I found from the internet, CompareHash does not require for the password to be compared be hashed. The password to be checked is not being hased within CompareHash, thus when comparing this password with the one obtained and stored beforehand do not match.

I appreciate a lot if someone could lend his/her help, in helping me to solve this problem


May 13, 2009 at 5:41 AM


What is your goal on the first scenario that you've described? Are you trying to compare the hash value of the first run to the hash value of the second run? Also can you point me to the link where you find problem with the CompareHash?

Valiant Dudan
Global Technology & Solutions
Avanade, Inc.

May 13, 2009 at 12:23 PM
I have solved the problem. I was truncating the hashvalue.