-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Updating Encrypted Fields
PostPosted: Mon Feb 27, 2006 6:55 am 
Beginner
Beginner

Joined: Fri Feb 17, 2006 1:28 pm
Posts: 24
Heya,

Does anyone know how you might update an encrypted filed using hibernate in a MySQL database. The old query used to be

UPDATE User SET password = AES_ENCRYPT('pass', 'key') where user_id = 1;

Ive had a good look for this around but found nothing so far!

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 27, 2006 11:08 am 
Beginner
Beginner

Joined: Fri Jul 30, 2004 2:53 pm
Posts: 33
Location: Washington, DC
I actually don't think there is a way to do it with hibernate, but one way to do it would be to encrypt the data in Java, then store it in the DB. You might find this link helpful:

http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 27, 2006 1:22 pm 
Beginner
Beginner

Joined: Fri Feb 17, 2006 1:28 pm
Posts: 24
Thanks for that and I had a good look at it but it doesn’t do really what i need it to do. I need to somehow set the private key value, not just use a generated key, so im also able to decrypt the String once its returned from the database.

So the private Key value in the example above is 'key'. I looked at the API for all the associating objects, but couldn’t see how this would be set. Any ideas?

Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.