Solved

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

Posted on 2013-11-20
4
3,775 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
[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
4 Comments
 
LVL 42

Assisted Solution

by:Eugene Z
Eugene Z earned 167 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 166 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 167 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Amazon AWS Windows with SQL Web For Business Application 3 33
SQL Query Task 11 43
SCOM to SQL port 14xx failed? 1 31
SQL Instance service gone? 5 36
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how the fundamental information of how to create a table.

756 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