wood burning stoves 2.0*
The moose likes JDBC and the fly likes Help in DBMS_OBFUSCATION_TOOLKIT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Help in DBMS_OBFUSCATION_TOOLKIT" Watch "Help in DBMS_OBFUSCATION_TOOLKIT" New topic
Author

Help in DBMS_OBFUSCATION_TOOLKIT

Anand Barhate
Greenhorn

Joined: Mar 09, 2009
Posts: 1
Hello,
I am trying to use DBMS_OBFUSCATION_TOOLKIT to encrypt and decrypt some data.

Here is the prog for that but when I use returned data for decrypting using same key I do not get same results.
Am I missing some step.

String encryptionKey="tiger123";

String encryptedString = "";



try {

CallableStatement cstmt;



con = dataSource.getConnection();

String procedureCall = "{call dbms_obfuscation_toolkit.DES3Encrypt(INPUT_STRING =>?,KEY_STRING=>?,ENCRYPTED_STRING=>?)}";

//String procedureCall = "{call crypt_util.crypt(p_str =>?,p_key=>?)}";



cstmt = con.prepareCall(procedureCall);

cstmt.setString(1, "anand123");

cstmt.setString(2, encryptionKey);

cstmt.setString(3, encryptedString);



cstmt.registerOutParameter(3, Types.VARCHAR);



cstmt.executeUpdate();



encryptedString = cstmt.getString(3);



System.out.println("encryptedString " + encryptedString);



cstmt.close();

}

catch (SQLException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

catch(Exception ce) {

logError(ce);

}

finally {

try {

con.close();

} catch (SQLException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}


Any help will be much appreciated..

Thanks,
Anand
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help in DBMS_OBFUSCATION_TOOLKIT
 
Similar Threads
how to call a javabean method from jsp using setproperty
ORA-01460: unimplemented or unreasonable conversion requested
problem with update and delete though insert and select working fine
Errors from server to client
Can anyone help me in shale frmework for writing JSF test cases?