Solved

Generate Hash Key in SQL Server 2005 using SHA 512 algorithm

Posted on 2011-03-14
6
2,339 Views
Last Modified: 2012-05-11
How to generate hash keys for a table data in SQL Server 2005 using SHA 512 algorithm?
0
Comment
Question by:Muralidharand
  • 4
6 Comments
 
LVL 9

Expert Comment

by:mayank_joshi
ID: 35127261
try:-

Declare @crypt NVARCHAR(100);
set @crypt='test';

EXEC sp_OASetProperty @crypt, 'HashAlgorithm', 'sha256'
 EXEC sp_OAMethod @crypt, 'HashStringENC', @hash OUT, @s

 PRINT 'SHA256:'

 PRINT @hash

Open in new window

0
 
LVL 9

Expert Comment

by:mayank_joshi
ID: 35127281
before running the above sql you will have to "Enable Ole automation" for SQL Server.
Follow these steps:-

start -> programs ->MS sql 2005 -> configuration tools -> surfce area configuration -> Surface area conf for features ->

Ole automation -> select the Enable check box and save
0
 
LVL 9

Expert Comment

by:mayank_joshi
ID: 35127287
OLE Automation can also be enabled through:-

exec sp_configure 'Ole Automation Procedures', 1
go
reconfigure
go

Open in new window

0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 9

Accepted Solution

by:
mayank_joshi earned 500 total points
ID: 35127292
the following link may be helpful for other encryption techniques:-

http://www.example-code.com/sql/crypt_hash_algorithms.asp
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 35128505
Depending on the length of the string, you can possibly use HASHBYTES.  Hashbytes supports SHA and SHA1.

http://msdn.microsoft.com/en-us/library/ms174415%28v=sql.90%29.aspx
0
 
LVL 1

Author Closing Comment

by:Muralidharand
ID: 35196895
Your post was helpful.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What is the best way to calculate hours worked 5 71
Sql Permission 6 61
SQL Server Degrading on Write 13 68
Whats wrong in this query - Select * from tableA,tableA 11 32
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question