Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Security / October 2005

Tip: Looking for answers? Try searching our database.

HashBytes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
LucFastLife - 08 Oct 2005 01:53 GMT
I have a DB with SSN. I would like to encrypt using HashBytes with salt.

I ran
UPDATE tablex
SET essn=HashBytes('SHA1',ssn+salt)

it runs correctly but when I query for WHERE
essn=HashBytes('SHA1','111-11-2222salt') it does not find the record

ssn is a nvchar column salt is also nvchar column
Please help. Thx
Dan Guzman - 08 Oct 2005 02:10 GMT
> ssn is a nvchar column salt is also nvchar column

In that case, specify a Unicode string:

WHERE ssn=HashBytes('SHA1', N'111-11-2222salt')

Signature

Hope this helps.

Dan Guzman
SQL Server MVP

>I have a DB with SSN. I would like to encrypt using HashBytes with salt.
>
[quoted text clipped - 7 lines]
> ssn is a nvchar column salt is also nvchar column
> Please help. Thx
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.