Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Generate Hash Key in SQL Server 2005 using SHA 512 algorithm

Posted on 2011-03-14
6
Medium Priority
?
2,562 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 9

Accepted Solution

by:
mayank_joshi earned 1500 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

721 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