Why do MessageDigests differ in diferent Machines?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Paulo_Melo
Posted On:   Friday, December 7, 2001 08:30 AM

Why do MessageDigest run differently in diferent Machines? public static void main(String[] args) { try { MessageDigest md = MessageDigest.getInstance("MD5"); String pass = "192168172115"; md.update(pass.getBytes()); md.digest(); String crypt = "341/001/200112073"; md.update(crypt.getBytes()); System.out.println(md.digest(pass.getBytes())); } catch (Exception) { } } I would like to send a digest as a validation between two machines. Both should run the code above and the result should be compared. Strange is that in both machines the code runs differently... if you r   More>>

Why do MessageDigest run differently in diferent Machines?


			
public static void main(String[] args) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
String pass = "192168172115";
md.update(pass.getBytes());
md.digest();
String crypt = "341/001/200112073";
md.update(crypt.getBytes());
System.out.println(md.digest(pass.getBytes()));
} catch (Exception) {
}
}



I would like to send a digest as a validation between two machines. Both should run the code above and the result should be compared. Strange is that in both machines the code runs differently...


if you run several times on the same machine the hash is always the same.


thanks in advance...

   <<Less
About | Sitemap | Contact