Solved

Storing Data Encrypted in SQL 2K possible?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now