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
Solved

Storing Data Encrypted in SQL 2K possible?

Posted on 2006-11-24
5
408 Views
Last Modified: 2012-05-05
Hello all.  Here is what I am trying to accomplish.  I can access an external SQL Server which is open just to my specific IP address.  What I want to do is somehow setup a SQL Job to transfer a two field table and store the data encrypted on the external box.  Then in a application I have decrypt the data possibly.  Is there a way in SQL Server to lock down the table and store the data encrypted?   I know I can do this in a application but the problem is we are talking millions of rows I need to transfer on a weekly basis.
0
Comment
Question by:sbornstein2
  • 3
  • 2
5 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 250 total points
ID: 18006333
You can try the LetLib Encriptioniser (www.netlib.com) or xpcrypt (www.xp_crypt.com)
0
 

Author Comment

by:sbornstein2
ID: 18006354
Well this is what I am hoping to do.  I want to run a DTS transfer of data every week.  After the data gets inserted into my table,  is there a way to just run a stored procedure to encrypt the data and then have the key external that we can use in our apps to decrypt the data?   Then after the DTS Transfer the next step in the job would be to run the stored proc to encrypt it?  I really only need to do this to one field and its not like credit card data or anything.
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 18006395
OK, You can write ur own encryption and the  decryption algorithm or can use any of the above.
0
 

Author Comment

by:sbornstein2
ID: 18011746
thanks anees I will check out xpcrypt
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 18011762
Here is an example on how to use this , u need to install the s/w first, and then u can create the following functions (if you want)

CREATE FUNCTION MyEncrypt  (@src varchar (32) , @password varchar (32)) RETURNS varchar(100) AS BEGIN
     declare @out varchar(100)
     exec master..xp_aes128_encrypt @src,@password,@out output
     return @out
END
go


CREATE FUNCTION MyDecrypt  (@src varchar (100), @password varchar (32)) RETURNS varchar(32) AS BEGIN
     declare @out varchar(32)
     exec master..xp_aes128_decrypt @src,@password,@out output
     return @out
END

That's all.

Now encrypt whole column use:

update SecretTable set creditcard = dbo.MyEncrypt(creditcard,'password')

Insert SecretTable (name,creditcard) values
(dbo.MyEncrypt('Aneesh','password'),dbo.MyEncrypt('123407234987545','password'))

To select use :

select dbo.MyDecrypt(name,'password'),dbo.MyDecrypt(creditcard,'password') where name= dbo.MyEncrypt('Aneesh','password')
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how the fundamental information of how to create a table.

840 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