I am working on a login frame that checks user input password against the password in a SQL database. I convert the text into an MD5 to store in the database with the following
HASHBYTES('MD5', 'JavaTest')
And that produces 5E58D71FBD6D17577AAAB8711264A813.
Then in java I use the following code to attempt to convert the same password "JavaTest" into MD5 to compare against.
MessageDigest m = MessageDigest.getInstance("MD5");
m.update(password.getBytes());
byte[] digest = m.digest();
BigInteger bigInt = new BigInteger(1, digest);
hashText = bigInt.toString();
But that produces the string 150157350912923000195076232128194914284
What am I doing wrong?
EDIT: I do not believe this is a duplicate because I have researched answers and it has gotten me this far but I can not figure out what I am doing wrong.