import java.security.MessageDigest;这是我的全部代码,我想以往一样,run as -->java application,结果说could not find the main
import java.security.NoSuchAlgorithmException;
public class MD5Test {
/**
* @param args
*/
public static void main(String[] args) {
String s = "123456";
char hexDigits[] = {
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f'
};
char str[];
byte strTemp[] = s.getBytes();
try {
MessageDigest mdTemp = MessageDigest.getInstance("MD5");
mdTemp.update(strTemp);
byte md[] = mdTemp.digest();
int j = md.length;
str = new char[j * 2];
int k = 0;
for (int i = 0; i < j; i++){
byte byte0 = md[i];
str[k++] = hexDigits[byte0 >>> 4 & 0xf];
str[k++] = hexDigits[byte0 & 0xf];
}
System.out.println(str);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
}
}
控制台显示 java.lang.ClassNotFoundException,求大神帮忙解决下。在附加一个问题,我网上看到说md5加密已经到几秒就能被破解的地步了,那现在一般都用什么加密急速啊
加密
------解决方案--------------------