Java DatabasesDiscussion specific to working with Java Databases. For other Java topics, please see related Java forums. For database discussions not specific to Java, please see the Database category.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Java Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Hi All
I have to store password in encrypted form in the database using JAVA.
i need a technique with which i should be able to enctrypt it using either key or without using key. I can not use the auto generated key. If anybody can send some code examples that would be very helpful to me.
Thanks
Inderjeet
for (int i = 0; i < digestBytes.length; i++) {
//Convert it to positive integer and then to Hex String
hex = Integer.toHexString(0xFF & digestBytes[i]);
//Append "0" to the String to made it exactly 128 length (SHA-512 alogithm)
if (hex.length() < 2)
sb.append("0");
sb.append(hex);
}
}
catch (Exception ex) {
System.out.println(ex.getMessage());
}
I think the code posted is to digest the given text, i dont think you can get back the original text from digest. If you want to compare then try digesting the input and compare it with already digested text.