Solved

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

Posted on 2013-11-20
4
3,880 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 43

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Tempdb Contention - SQL SERVER 10 41
connection to SQL 2012 error in windows 10 18 49
Using a SUBQUERY for the set variable 10 30
SQL Server Error: 4060 8 33
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
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
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

752 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