Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Storing Data Encrypted in SQL 2K possible?

Posted on 2006-11-24
5
Medium Priority
?
433 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
[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
  • 3
  • 2
5 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 1000 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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.

618 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