Encrypting data before writing to a database
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   tim_fox
Posted On:   Monday, January 26, 2004 06:03 PM

I have been experimenting with the JCE package and have been successful in encrypting and decrypting data in a single session. At risk of sounding like an idiot, I have the following question : using JCE, how can I encrypt data with the same key so that it can be decrypted at a later date? I assume that a key can be stored and used to encrypt / decrypt data as needed. The practical application for this is in the need to store demographic information (possibly financial info) about users in an Oracle database. I would need to encrypt it before storing it and then decrypt it as needed. I have read over loads of Sun documentation, but have not yet stumbled onto this example. Any help would be greatly ap   More>>

I have been experimenting with the JCE package and have been successful in encrypting and decrypting data in a single session.


At risk of sounding like an idiot, I have the following question : using JCE, how can I encrypt data with the same key so that it can be decrypted at a later date? I assume that a key can be stored and used to encrypt / decrypt data as needed.


The practical application for this is in the need to store demographic information (possibly financial info) about users in an Oracle database. I would need to encrypt it before storing it and then decrypt it as needed.


I have read over loads of Sun documentation, but have not yet stumbled onto this example. Any help would be greatly appreciated.


Thanks,


TGF

   <<Less

Re: Encrypting data before writing to a database

Posted By:   nosh_shir  
Posted On:   Tuesday, March 9, 2004 08:18 AM

plz give me the code

Re: Encrypting data before writing to a database

Posted By:   Christopher_Koenigsberg  
Posted On:   Tuesday, January 27, 2004 07:18 AM

Presumably you need to store the encryption key (presumably this is symmetric e.g. encryption and decryption both use the same key?). Perhaps you will have a set of keys e.g. in another table, and some identifier e.g. foreign key to that table? so you can tell which key was used, to encrypt a particular data element?

Re: Encrypting data before writing to a database

Posted By:   Anjan_Bacchu  
Posted On:   Monday, January 26, 2004 09:34 PM

Hi there,



There is an open source version of JCE available at cryptix



You can get a good sample of how to do this here
http://www.orlingrabbe.com/javacrypt_index.htm -- this gives a pretty good example.



Some download software(JCE unlimited strength) on using unlimited strength crypto in JDK 1.4.2 is at http://java.sun.com/j2se/1.4.2/download.html



BR,

~a
About | Sitemap | Contact