Learn about java encryption and PHP, and help me solve it. Importjava. security. messageDigest; Strings & quot; I am abc & quot; byte [] bs. getBytes (& quot; UTF8 & quot;); for (inti0; I & lt; B. length; I ++) {System. ou. learn about java encryption and PHP, and help me solve it.
Import java. security. MessageDigest;
String s = "I am abc ";
Byte [] B = s. getBytes ("UTF8 ");
For (int I = 0; I <B. length; I ++ ){
System. out. println (B [I]); // The byte array obtained here is the same as the php unpack ("c *", $ str.
}
System. out. println ("-------------");
MessageDigest md = MessageDigest. getInstance ("MD5 ");
Md. update (B );
Byte tmp [] = md. digest (); // The MD5 calculation result is a 128-bit long integer.
// The result is a 16-byte array.
For (int I = 0; I <tmp. length; I ++ ){
System. out. println (tmp [I]);
}
------ Solution --------------------
From the code you write, you have the ability to solve it on your own.
PHP code
$ Str = "I am abc"; $ B = unpack ("C *", md5 ($ str, 1); print_r ($ B );