-->
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.  [ 2 posts ] 
Author Message
 Post subject: Encryption/Decryption og DB fields through HIbernate?
PostPosted: Sat Aug 30, 2008 1:49 am 
Newbie

Joined: Sat Aug 30, 2008 1:38 am
Posts: 1
Hi ,
I am very new to this Hibernate great world. I need to Encrypt few fields of DB and need to decrypt same fields .
May I know the list of Algoriths which can I use in " name="algorithm">PBEWithMD5AndDES"

I am using below code for same :
--------------------------------------
?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC

"-//Hibernate/Hibernate Mapping DTD 3.0//EN"

"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<typedef name="encryptedString" class="org.jasypt.hibernate.type.EncryptedStringType">
<param name="algorithm">PBEWithMD5AndDES</param>
<param name="password">thisisatest</param>
<param name="keyObtentionIterations">1000</param>
</typedef>
<class name="roseindia.tutorial.hibernate.Contact" table="CONTACT">
<id name="id" type="int" column="ID" >
<generator class="increment"/>
</id>
<property name="firstName" column="FIRSTNAME" type="encryptedString" />

</class>
------------------------------------------------------------------------
One thing I am clear that since I am using the PBEWithMD5AndDES as Algorith I cant decrypt the fields :(. Is there any Algorithem which can use in this place and Do the Encryption and Decryption.


Last edited by kashinath on Sat Aug 30, 2008 2:52 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Encryption/Decryption og DB fields through HIbernate?
PostPosted: Mon Sep 01, 2008 4:28 am 
Newbie

Joined: Mon May 29, 2006 7:37 am
Posts: 4
AFAIU you need to save some passwords in DB, if so you can read about "hashing with salt" technique: http://www.google.ru/search?q=hash+salt+password


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.