[jboss-user] [EJB 3.0] - Storing Password as MD5 Hash

blackers do-not-reply at jboss.com
Mon Jul 30 21:44:33 EDT 2007


Is it possilbe to use EJB3 and be able to store my password as a MD5 hash instead of in plain text?

I have tried 


  | 
  | @Column(name = "password", nullable = false, length = 255)
  | 	@NotNull
  | 	@Length(max = 255)
  | 	public String getPassword() {
  | 		return this.password;
  | 	}
  | 
  | 
  | 	public void setPassword(String password) {
  | 		this.password = Util.createPasswordHash("MD5", Util.BASE64_ENCODING, null, null, password);
  | 	}
  | 
  | 

However the correct password is not stored, I guess the problem is if the setPassword is called more than once I am getting the Hash of the Hash.



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068968#4068968

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068968



More information about the jboss-user mailing list