Solved

Storing Data Encrypted in SQL 2K possible?

Posted on 2006-11-24
5
404 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

803 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