Please see the code SQL:
create table [User] (ID int identity not null,EmailAddress varchar(50), [Password] BINARY(32),primary key (ID))
INSERT INTO [User] (EmailAddress,[Password]) values ('testuser@hotmail.co.uk',hashbytes('SHA256','test'))
A null value is entered into the password field. Why is this?
I was hoping the following query would return one row, however it returns no rows:
SELECT * FROM [User] where password = hashbytes('sha256','test')
As you can probably tell I am new to hashing algorithms.
The following question states that you should store a password as a BINARY(32): CHAR(64) or BINARY(32) To Store SHA256 Hash in SQL SERVER