title: Encrypt in Java and Decrypt in MS SQL Server
body: <p>My application flow is as follow. </p>
  
  <p>JAVA APP ----> MS SQL (Tables)---> MS SQL (Stored procedure) ---> Another DB</p>
  
  <p>Here from Java application i am pushing certain Sensitive information that  i even want to hide from DBA. So i want to encrypt those column values from java and before the Stored Procedure pushes it to Another DB i want to Decrypt it in SQL code. </p>
  
  <p>But the <strong>Problem is that MS SQL do not allow Custom Keys to be passed for Encryption or Decryption</strong> .It generates those keys itself and we cant see those key values. So i cant decrypt them as i cant pass on my keys (Which i used to encrypt values in Java code) in SQL DecryptByKey Mehtod. i am using 3DES encryption Scheme.
  Can any one help me with this issue.</p>
  
  <p><strong>Now the core Question is</strong>. How can i decrypt any 3DES based Encrypted Value 
  (i am encrypting this value in Java Code) in MS SQL server 2008 when i know all the details about of Encryption value such as salt and other things. Is there any method in SQL where i can pass my custom key  and decrypt the values.</p>
  
  <p>Any help will be deeply appreciated. </p>