Unified Communication for your Biz

Improve your contact center performance. See how you can make a difference.

Watch Now 


Reach the ICT Community

Engage and build your ICT audience with CIOL online advertising.

Know more 

Tips to encrypt data in SQL Server
SQL Server 2005 provides easier functions for encrypting and decrypting user sensitive information such as credit card numbers or bank account details, so as to deter hacking
Rahul Sah
Thursday, March 06, 2008

©PCQuest


Would you like to on this article?

Skip Navigation Links.
Collapse <div class='CommentsContainer'>Read Comments</div>
Read Comments
karthickreddyk said on 12/30/2008 6:53:59 PM:
its really nice. I have to say thanks for you . your article is too good and understand way is also good
to karthickreddyk
Patrick said on 5/4/2008 2:59:57 AM:
i have been looking around for this for months now. ive found many so called tutorials that say they encrypt and when looking closer into the code, it wouldnt work. thanks
to Patrick
Dattatray said on 4/9/2008 1:40:26 PM:
What is passphrase nunber
to Dattatray
Nitin said on 3/27/2008 7:23:48 PM:
dfgdfg dfgdf dfgd
to Nitin
esb1922 said on 3/18/2008 2:50:35 AM:
Ive been trying to encrypt 6-digit numbers using your scenario but when Im trying to retrieve them, I get digits separated with dots. Like if I saved 809763, I will get 8.0.9.7.6.3. Do you have any idea why does it happen? Here are steps I did: 1. I created keys and certificate create master key encryption by password = password; create certificate Cert1 with subject = Cert1; create symmetric key Key1 with algorithm = TRIPLE_DES encryption by certificate Cert1; 2. Then I generate 6 digit number and pass it to a stored procedure in order to save it: open symmetric key Key1 decryption by certificate Cert1 INSERT INTO UserCodes (username, CodeEncrypted) VALUES (@username, EncryptByKey(Key_GUID(Key1), @code)) /*@code has value to save */ close all symmetric keys 3. open symmetric key Key1 decryption by certificate Cert1 SELECT @code = CAST(DecryptByKey(CodeEncrypted) As varchar(12)) FROM UserCodes WHERE username = @username close all symmetric keys
to esb1922
  
 
Name  
Email    
Your reply
 
>