Generate Hash Key in SQL Server 2005 using SHA 512 algorithm

How to generate hash keys for a table data in SQL Server 2005 using SHA 512 algorithm?
LVL 1
MuralidharandAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
mayank_joshiConnect With a Mentor Commented:
the following link may be helpful for other encryption techniques:-

http://www.example-code.com/sql/crypt_hash_algorithms.asp
0
 
mayank_joshiCommented:
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
 
mayank_joshiCommented:
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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
mayank_joshiCommented:
OLE Automation can also be enabled through:-

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

Open in new window

0
 
BrandonGalderisiCommented:
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
 
MuralidharandAuthor Commented:
Your post was helpful.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.