Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Is it possible to encrypt/decrypt TripleDES encryption from within T-SQL?

Posted on 2013-11-20
4
Medium Priority
?
4,540 Views
Last Modified: 2013-11-23
Is it possible to encrypt/decrypt TripleDES encryption from within T-SQL?

I'm using SQL SERVER 2008 R2.

Could you please guide me how to achieve this? Thanks in advance.
0
Comment
Question by:Easwaran Paramasivam
4 Comments
 
LVL 43

Assisted Solution

by:Eugene Z
Eugene Z earned 668 total points
ID: 39664541
yes, you can try

function ENCRYPTBYPASSPHRASE
Encrypt data with a passphrase, using the TRIPLE DES algorithm with a 128 key bit length.
http://technet.microsoft.com/en-us/library/ms190357(v=sql.105).aspx

and Decrypt with  DecryptByPassPhrase
Decrypts data that was encrypted with a passphrase.

http://technet.microsoft.com/en-us/library/ms188910(v=sql.105).aspx
0
 
LVL 30

Assisted Solution

by:Rich Weissler
Rich Weissler earned 664 total points
ID: 39664562
Yes, TripleDES is one of the algorithms available in SQL 2008 R2.  There are two Triple DES algorithms available actually... 128 bit and 192 bit versions.  These instructions provide the commands needed to encrypt, then view the decrypted values.
0
 
LVL 51

Accepted Solution

by:
Mark Wills earned 668 total points
ID: 39664770
If you want your encrypted data to be decrypted externally (or vice versa) then it is imperative that any keys are symmetric and if going to another database then there are fairly strict rules how to export that key.

There is also the choice of using external programs to encrypt / decrypt as exemplified by the code extract (down the bottom of) : http://forums.asp.net/t/1891297.aspx

If completely within SQL Server, then it does support TrippleDes very well and the above posts contain most of the relevant links.

A walkthrough example of triple des is presented by Pinal Dave (interestingly, has been an ative member of EE) : http://blog.sqlauthority.com/2009/04/28/sql-server-introduction-to-sql-server-encryption-and-symmetric-key-encryption-tutorial-with-script/
0
 
LVL 16

Author Closing Comment

by:Easwaran Paramasivam
ID: 39671265
Thanks.
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

I have a large data set and a SSIS package. How can I load this file in multi threading?
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

971 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