Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sql Server 2005: what data type to use to store passwords hashed by SHA-256 algorithm?

In Sql Server 2005 what data type should be used to store passwords hashed by SHA-256 algorithm?

The data is hashed by the application and passed to the database

like image 992
kristof Avatar asked Oct 30 '08 23:10

kristof


1 Answers

I prefer to convert the hash-Code to an Hex-String in this case a varchar(64) will do the trick or an varchar (66) if you like a "0x"-prefix. In this way it is much easier to compare manually or (re)set values you have to copy/paste from other places. e.g you lost your admin-PW and want to reset it via SQL...

like image 191
Peter Parker Avatar answered Nov 16 '22 01:11

Peter Parker