This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am sharing the use of HASHBYTE() function in SQL Server. I am late for sharing this because HASHBYTE is not a new feature.
Recently, one developer asked few questions on TDE for specific column encryption. I suggested him to use HASHBYTE() and got to know that I didn’t share anything about it.
The HASHBYTE() returns the MD2, MD4, MD5, SHA, SHA1, or SHA2 hash of its input in SQL Server. You can use this algorithm for encrypting important column like a password.
SQL Server: Transparent Data Encryption (TDE) to Encrypt a Database
Examples:
1 2 3 4 5 6 |
SELECT HASHBYTES('MD2', 'dbrnd.com') AS MD2 SELECT HASHBYTES('MD4', 'dbrnd.com') AS MD4 SELECT HASHBYTES('MD5', 'dbrnd.com') AS MD5 SELECT HASHBYTES('SHA1', 'dbrnd.com') AS SHA1 SELECT HASHBYTES('SHA2_256', 'dbrnd.com') AS SHA2_256 SELECT HASHBYTES('SHA2_512', 'dbrnd.com') AS SHA2_512 |