SQLTeam.com | Weblogs | Forums

Should I store salt on SQL Server as varchar or varbinary and in hex?



I'm working on implementing a hash. I intend to store the salt it in a SQL Server database table. The salt will be at least 32 bytes. Should the salt be in hex form or should I convert it to a string, integer, or something else? Also, what data type should I use to store the salt: varchar, varbinary, or something else?

For security, it really doesn't matter because the salt is not a secret. But in terms of performance and maybe readability, it might.

Thank you very much.


If it is nothing important to be converted into hash then it can be stored in varchar itself


Oh OK, that's good. Thank you very much for your help!