package service;

import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class EncodePassword {

	public static String encodePassWord(String password) throws NoSuchAlgorithmException, UnsupportedEncodingException
	{
		MessageDigest md = MessageDigest.getInstance("SHA-256");
		byte[] hash = md.digest(password.getBytes("UTF-8"));
		password = new String(hash);
		
		return password;
	}
	
}

@@ -27,39 +27,23 @@
 ava.
-io.UnsupportedEncodingException
+math.BigInteger
 ;%0Aim
@@ -181,22 +181,12 @@
 ing 
-encodePassWord
+hash
 (Str
@@ -234,41 +234,44 @@
 tion
-, UnsupportedEncodingException%0A%09%7B
+%0A%09%7B%0A%09%09String hashingPassword = null;
 %0A%09%09M
@@ -283,18 +283,22 @@
 eDigest 
-m
 d
+igest
  = Messa
@@ -323,104 +323,217 @@
 ce(%22
-SHA-256%22);%0A%09%09byte%5B%5D hash = md.digest(password.getBytes(%22UTF-8%22));%0A%09%09password = new String(hash);
+MD5%22);%0A%09%09digest.update(password.getBytes(), 0, password.length());%0A%09%09  %0A%09        //Converts message digest value in base 16 (hex) %0A%09        hashingPassword = new BigInteger(1, digest.digest()).toString(16);%0A%09%09
 %0A%09%09%0A
@@ -541,17 +541,24 @@
 %09return 
-p
+hashingP
 assword;

edit Encodepassword file