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: Encryption of Password using hibernate
PostPosted: Fri Mar 03, 2006 5:55 am 
Newbie

Joined: Wed Feb 22, 2006 2:15 am
Posts: 10
Is there any means by which you can encrypt password using hibernate ?
MySQL provides various functions like md5() to encrypt password.
Is there any similar mechanism in hibernate to encrypt password.

It is very urgent.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 03, 2006 6:23 am 
Regular
Regular

Joined: Wed Feb 08, 2006 3:59 pm
Posts: 75
You can create an UserType for this purpose, maybe something like this :

http://jsourcery.com/output/sourceforge/openreports/0.9.0/org/efs/openreports/util/EncryptedStringUserType.source.html


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 03, 2006 6:32 am 
Newbie

Joined: Wed Feb 22, 2006 2:15 am
Posts: 10
Thanks.Is there any other solution?

This is the mapping file for User :


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping
auto-import="false"
>
<class
name="com.uniken.adsalesentities.UserImpl"
table="User"
dynamic-update="false"
dynamic-insert="false"
select-before-update="false"
>

<id
name="userId"
column="userId"
type="java.lang.String"
unsaved-value="null"
>
<generator class="assigned">
</generator>
</id>

<property
name="userName"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="userName"
/>

<property
name="password"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="password"
/>


<many-to-one
name="userRole"
class="com.uniken.adsalesentities.UserRoleImpl"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="userRoleId"
/>

<many-to-one
name="country"
class="com.uniken.adsalesentities.CountryImpl"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="countryId"
/>

<many-to-one
name="lineManager"
class="com.uniken.adsalesentities.UserImpl"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
column="lineManagerId"
/>

<property
name="emailId"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="emailId"
/>

<property
name="mobileNumber"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="mobileNumber"
/>

</class>

</hibernate-mapping>


As you password is string type and not encrypted.
Is there any means to encrypt using hibernate.

Hibernate team please help . It is urgent.


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.