Encrypt in Java and Decrypt in MS SQL Server

My application flow is as follow.

JAVA APP ----> MS SQL (Tables)---> MS SQL (Stored procedure) ---> Another DB

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.

But the Problem is that MS SQL do not allow Custom Keys to be passed for Encryption or Decryption .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.

Now the core Question is. 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.

Any help will be deeply appreciated.

-------------Problems Reply------------

You can encrypt whole jdbc traffic with SSL. Look at https://msdn.microsoft.com/en-us/library/bb879935%28v=sql.110%29.aspx

Category:java Views:1 Time:2018-11-04

Related post

  • Separating encrypt and decrypt privilidges in SQL Server 2010-01-27

    I am trying to save sensitive information on DB with encryption and all users can put their information in DB after encrypting it, but only privilidged users can decrypt and see it. How can i achieve it using SQL Server 2008 key/certificate/encryptio

  • Padding error - when using AES Encryption in Java and Decryption in C 2009-12-18

    I have a problem while decrypting the xl file in rijndael 'c' code (The file got encrypted in Java through JCE) and this problem is happening only for the excel files types which having formula's. Remaining all file type encryption/decryption is happ

  • AES Encryption in Java and Decryption in C# 2011-03-14

    Hello I've Encrypted Hex string and Key that has been encrypted using standard AES Algorithm. Code: final String key = "=abcd!#Axd*G!pxP"; final javax.crypto.spec.SecretKeySpec keySpec = new SecretKeySpec(key.getBytes(), "AES"); final javax.crypto.Ci

  • To decrypt Password using sql server 2014-12-01

    In the below query i want to decrypt the password i tried but it displays null.I refer this example "http://www.dotnetheaven.com/article/encrypt-and-decrypt-text-in-sql-server-2008" to my query.Pls help me to solve the issue. SELECT UserID, UserFirst

  • DES encryption in Java and PHP 2011-07-14

    I need to create a class that will encrypt the text and sends that to PHP server. Then PHP server Decode that. But problem is that, I don't know PHP so I can not write code with same logic (as I used in Java) to decrypt the text, so I am fully depend

  • AES Encryption with java and WP7 2011-08-17

    We have code for AES-128 encryption in Java and we want some equivalent code in WP7. However, we run into a problem: The two implementations yield different encrypted texts Here is the code we're using: Java Code package com.emap.services; import com

  • encrypt with BC and decrypt with pgp 6.5.8 2011-08-25

    I am trying to encrypt with BC and decrypt with pgp 6.5.8 . The encryption aspect of it works and i am able to decrypt i pgp 6.5.8 . But pgp 6.5.8 complains the signature is bad. Can anyone help me with this ? Thanks --------------Solutions----------

  • Encrypt in C# and decrypt in Flex 2012-04-03

    I need to decrypt some data in Flex that is encrypted in C# and written to a file. I settled on blowfish for simplicity's sake using the as3crypto As3 library and Bruce Schneier C# library. AS3 as3crypto link Bruce Schneier C# blowfish link I can get

  • Encryption in .NET and decryption in Android throws BadPaddingException: pad block corrupted 2012-05-03

    I did lot of research but i couldn't find answer to my issue. I'm doing AES encryption (Rijndael block size 128 bits) in .NET and decryption in Android (AES) with same password, salt & IV between them. C# Encryption code snippet: byte[] initVecto

  • Encrypting data in order to store in SQL Server 2012-01-01

    I use VS2010, C#, SQL Server 2008 to develop my ASP.NET web app. I'm searching for a function that can encrypt my data before storing it into SQL Server tables, I had recently used a function which performed it, this function had a key, that was used

  • java impersonation to connect to sql server using windows authentication 2009-04-29

    right now I have the following architecture built with classic asp and visual basic 6 I have a COM+ component developed in VB6 which connects to the dabatase. I set the DB conf thru an .udl file configured with integrated security. At the web server

  • Table and Index size in SQL Server 2008-11-25

    Can we have a SQL query which will basically help in viewing table and index sizes in SQl Server. How SQL server maintains memory usage for tables/indexes? --------------Solutions------------- The exec sp_spaceused without parameter shows the summary

  • Create a Java Stored Procedure in MS SQL Server 2005 2009-06-09

    Can I create a java stored procedure in MS SQL Server 2005 like in Oracle or DB2? --------------Solutions------------- No, you can't. You can create a .net stored procedure instead. http://msdn.microsoft.com/en-us/library/zxsa8hkf(VS.80).aspx For gen

  • Enable sys, guest and information_schema users in SQL Server 2009-09-08

    I had a script run against one of my databases that attempted to drop a bunch of users. All the users that had the drop attempted against them were disabled and displayed the little red down arrow on their icon in Management Studio. I was able to rev

  • What's the difference between peer-to-peer and merge replication with SQL Server? 2009-09-16

    What's the difference between peer-to-peer replication and merge replication using SQL Server? --------------Solutions------------- Peer-to-Peer Transactional Replication is typically used to support applications that distribute read operations acros

  • Binary read jpeg and store it in SQL Server db 2010-01-11

    I have a jpeg file in my C drive from my vb.net application I want to binary read it and store it in SQL server. How can I do that? Thanks --------------Solutions------------- You can read a file into a byte array by calling File.ReadAllBytes. You ca

  • what is the difference between INSTEAD OF and AFTER trigger in SQL Server? 2010-03-23

    What is the difference between INSTEAD OF and AFTER trigger in SQL Server? INSTEAD OF trigger invoked before unique key constraint, will the AFTER trigger invoke after unique key constraint? --------------Solutions------------- AFTER trigger fires af

  • Store and retrieve html from sql server 2008 and display using ASP.NET MVC? 2010-06-02

    I am trying to store HTML and hyperlinks in my SQL server 2008 database. I want to also be able to display the hyperlinks and render the HTML accordingly. I am trying to do this in ASP.NET MVC, so I tried using the HTTPUtility.HtmlEncode() method, bu

  • Will using the TABLOCK and HOLDLOCK hints in SQL Server 2005 COMPLETELY prevent inserts until the end of the transaction? 2010-08-10

    I need to retrieve the identity field generated by SQL Server 2005. Usually I would just use SCOPE_IDENTITY or add an OUTPUT CLAUSE to the insert, however neither of these method help in this situation: as there is an INSTEAD OF trigger attached to t

  • Linked server (read data from pgsql and insert it into SQL Server) 2010-09-16

    I have a SQL Server 2005. I have created a linked server to PG SQL server. It works great. SELECT * FROM OpenQuery(POSTGRESQL_SERV, 'SELECT comp_id,comp_name FROM company WHERE comp_type = 5') I need to read all data from PG SQL and insert it into SQ

  • Split Multiply Arrays Loop Trough Records and Insert Records in SQL server 2008 2010-10-14

    I am trying to split multiple arrays and insert them into SQL Server. From my query string I receive the following Sport.aspx?ReaderID=A1B5A0F5C4E4A1B5A0F5C4E4&DataID=11B6C56A90B645B6C56A90B6,10 Oct 2010 13:15:20,|22B6C56A90B645B6C56A90B6,10 Oct

  • What are IN and OUT parameter in SQL Server 2010-11-07

    What are IN and OUT parameter in SQL Server? --------------Solutions------------- IN Parameters - parameters that pass data TO a stored Procedure OUT Parameters - parameters that are used to RETURN data FROM a stored procedure Refer MSDN for more det

  • Dimensions and fact tables using SQL Server 2008 2010-12-07

    I'm supposed to create a dimension and fact tables with SQL Server 2008 using TSQL, but I got the following error message : Unknown object type 'DIMENSION' used in a CREATE, DROP, or ALTER statement.and my code is : CREATE DIMENSION dim_date LEVEL jo

  • Storing and retrieving images in sql server 2005 in asp.net via c# 2010-12-09

    How do I store and retrieve images in sql server 2005 in asp.net with c# --------------Solutions------------- You may store them as binary data. You may write a module (derived from IHttpModule), register it for RequestBegin event. When request come

  • What is the differences between Cast and Convert functions in SQL Server with T-SQL? 2011-01-11

    Possible Duplicate: T-SQL Cast versus Convert What is the differences between Cast and Convert functions in SQL Server with T-SQL? --------------Solutions------------- Convert is a SQL server only function and Cast is more generic(can be used in othe

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.167 (s). 11 q(s)