密码使用SHA加密就可以了, 给你一个加密的例子,JAVA自带的 public static String hashMessage(String message){ MessageDigest md; try { md = MessageDigest.getInstance("SHA"); } catch (java.security.NoSuchAlgorithmException e) { throw new RuntimeException(e.getMessage()); } md.update(message.getBytes()); return new BigInteger(md.digest()).toString(); } 这里还有更详细的加密 public class sha1 { private int a = 0x67452301; private int b = 0xefcdab89; private int c = 0x98badcfe; private int d = 0x10325476; private int e = 0xc3d2e1f0; private int tmpData[] = new int[80]; private int tmpInt = 0;
public sha1() { }
private void init() { a = 0x67452301; b = 0xefcdab89; c = 0x98badcfe; d = 0x10325476; e = 0xc3d2e1f0; tmpInt = 0;
for(int i = 0; i < tmpData.length; i++) { tmpData[i] = 0; } }