I need to store passwords in my SQL database. Too high security is not needed at the moment, but instead of using MD5 hash with seed, I plan to use SHA1+seed to store my passwords.
Usage would be simply for a web site user login. So when a user logs in, my C# code would concatenate a salt+password, hash it, and then compare against whats stored in the database.
My question is that in SQL server, should I be storing the SHA1 has as-is (40 characters), or after converting them to Base64(28 characters)?
Most of the example of SHA1 hashing I saw online, seem to be finally converting it to Base64, but I am not sure, why or what would be the benefit of storing SHA1 after encoding to Base64.
A SHA-1 hash is a 160-bit value; hashing solutions will produce 20 bytes of output, including unprintable characters. Most implementations convert this into a readable format before storage, either to hexadecimal (40 bytes) or to base64 (~28 characters).
There’s no reason to convert a hex string to base64 before storage, so if your strings are already in hex, just leave ’em that way.