Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 23, 2012 12:44 AM by Decker Dong - MSFT
Nov 22, 2012 12:14 AM|LINK
rdb = newRfc2898DeriveBytes(
storedSalt ), 10000 );
passwordEnc = rdb.GetBytes( 256 );
To generate a 256 bit salted hash value which gets stored in the database.
The problem is that when I pull this value out of the database, it is only a 128 byte value and authentication
fails. The database field is varbinary(MAX) so why isn't it storing the full 256 bytes?
Nov 22, 2012 02:44 PM|LINK
see if declaring the passwordEnc vairable to be 256 bytes long fixes the issue
byte passwordEnc = new byte;
passwordEnc = rdb.GetBytes(256);
if that doesnt solve the issue, set a break point and go through each line of code one a time to make sure the byte value is actually 256 long
Nov 23, 2012 12:44 AM|LINK
Considering that you are saving byte collection, I think you can just use the three types instead: