• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help in DBMS_OBFUSCATION_TOOLKIT

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Forget this weirdo. You guys wanna see something really neat? I just have to take off my shoe .... (hint: it's a tiny ad)
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic