On Tuesday, June 10, 2003, at 02:21 PM, David C. Hicks wrote:
I found when doing some encryption work earlier this year that Oracle's RAW column type was the right choice in order to store the data after encryption. You also have to make sure that you provide enough space for any padding bytes that your encryption algorithm may add to the data.
I have base64 encoded encrypted data and plugged it into a TEXT for storage before, works nicely, and is friendly to deal with if you need to access it manually later. I haven't played with Oracle doing this, but we do it right now in Postgres and I cannot imagine it would be terribly different.
Doing it in a Field Conversion makes sense to me as that is exactly what it is - it just involves some data munging in addition to typical Database -> JDBC -> Java Object conversions.
If you need to maintain the ability to change keys/algorithms et, wrap the algorithm in a Strategy object dynamically loaded via reflection (OJB has lots of examples of this) and put the key in a properties object. It will take 15 more lines of code, but is infinitely more flexible.
-Brian
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
