What, exactly, should this code do? Are you looking for Java code that runs before inserting something in the DB/after getting something out of the DB, or something that runs in the DB?
My Requirement is DB Encryption/Decryption........
I have to write java program which will fetch the data from Database and put in the xml file.same data should be encrypted .same thing will apply for Decryption also.
I think you got clear idea. Please let me know if you have any solutions for this..
So the data is unencrypted in the DB, but should be encrypted in the XML file? And when it is transferred from the XML file to the DB, it should get decrypted? Is that correct?
If so, it sounds as if it has nothing to do with databases, but is merely about how to encrypt/decrypt data.
William Brogden
,
Author and all-around good cowpoke
How far have you gotten on this problem? Have you studied the javax.crypto package JavaDocs? Searched for code examples using google?
The most important point is that XML is a text format and must contain only legal unicode characters, while the initial result of encryption will be a byte[]. Therefore, your encrypted byte[] must be encoded to legal characters - base64 encoding is typically used.