This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Encrypted Tables/Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Encrypted Tables/Database" Watch "Encrypted Tables/Database" New topic

Encrypted Tables/Database

Tad Dicks
Ranch Hand

Joined: Nov 16, 2004
Posts: 264
I need to create a database where all the tables are encrypted (I am planning on using HSQLDB) and there are a couple ways I can see doing it but they both have issues. I could encrypt the entire table (in a text table) and then decrypt the entire thing into a memory table. Or I could just encrypt each row of data and decrypt them as I pull them out. The first option doesn't seem feasible to me with a table that consists of several hundred thousand records (am I wrong?) and in a way seems to defeat the purpose of encrypting the db if I'm going to decrypt the entire thing and have it in memory. The second option seems nice at first glance but I don't see how it would be possible to query against (except in the case of say: field1 = encrypt("value") but if you wanted to say something like: field1 > 50). It wouldn't work. Is there a standard way of dealing with this? Are there any tools specifically for doing this? The only way I can conceive of doing this is have an extensive list of non-encrypted indexs.

I've had requirements for passwords to be encrypted but never an entire database.

Tad Dicks
Ranch Hand

Joined: Nov 16, 2004
Posts: 264
Does anyone know of any foss (preferrably java based) databases that support encryption on an entire column? And will still let you run queries against the data?

Mr. C Lamont Gilbert
Ranch Hand

Joined: Oct 05, 2001
Posts: 1170

probably you would encrypt your data, but i never heard of encrypted relationships?
jQuery in Action, 2nd edition
subject: Encrypted Tables/Database
Similar Threads
javax.crypto.BadPaddingException: Given final block not properly padded
How encrpyt all files on web server so decryptable by all users' keys?
String encryption/decryption - 'block not properly padded' error
Can I save an encrypted symmetric key in a cookie?
Padding Exception