2

Is it possible to decrypt a file which is encrypted in sql server using 3DES algorithm?

Using java if I encrypt and save to sqlserver, then I am able to decrypt with out issues..

Is there any difference of encryption methods of sqlserver and java?

3
  • Why would you want to do that? Commented Dec 3, 2015 at 15:41
  • Thanks for the reply..., as there are already files in sqlserver DB and it is encrypted from the DB side..so i need to decrypt the files and view in java frontend. Commented Dec 3, 2015 at 15:54
  • You don't want to encrypt in the DB because if somebody intercepts the request between the program and the DB, they will have whatever you were trying to encrypt in the DB in plaintext which eliminates the purpose of encrypting. Commented Dec 3, 2015 at 15:58

2 Answers 2

2

You'd need to be using the same implementations, keys, lengths, chaining mode, initialization vectors etc. If any of the configuration of the algorithms is different, it will not decrypt successfully, this is by design.

If you're using the same for all of the above, in theory you could decrypt using paper and a pencil. Any different and you're looking at several million years of compute capacity to crack it.

ps: Use AES if you want it to be quicker AND more secure. Triple DES uses (as the name suggests) three passes of regular DES encryption, which is considerably slower than a single pass of the more modern AES encryption.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for the quick reply.. iam using the same key and the mode which is used in sql server, but iam not using the encryption certificate of sql server... is this iam missing and i dont know how to use the certificate in java code.
Oh, I wasn't expecting a certificate! Is this PGP style encryption where the key and signing etc. are also done asymmetrically? If so, the solution is a little more complex as you'll need to have some kind of certificate chain of trust.
We have files in sqlserver and these pdf file are encrypted in sqlserver using "TRIPLE_DES ENCRYPTION " and i need to decrypt in java using the same algorithm.
1

You will want to encrypt and decrypt in Java because of ease of use and the security it provides. Also as mentioned before AES is quicker and more secure. Even though triple DES is still in the secure range, it's takes so longer to compute.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.