• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2692
  • Last Modified:

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?
0
Muralidharand
Asked:
Muralidharand
  • 4
1 Solution
 
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
 
mayank_joshiCommented:
OLE Automation can also be enabled through:-

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

Open in new window

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:
the following link may be helpful for other encryption techniques:-

http://www.example-code.com/sql/crypt_hash_algorithms.asp
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now