/**
* 定义 加密算法,可用DES,DESede,Blowfish
/
private static final String Algorithm = "DESede";
/*
* 为加密密钥,长度为24字节
*/
final static byte[] keyBytes = "_ipudong_loginToken_plat".getBytes();
public static String encryptMode(String src) {
try {
// 生成密钥
SecretKey deskey = new SecretKeySpec(keyBytes, Algorithm);
// 加密
Cipher c1 = Cipher.getInstance(Algorithm);
c1.init(Cipher.ENCRYPT_MODE, deskey);
return byte2data(c1.doFinal(src.getBytes()));
} catch (java.security.NoSuchAlgorithmException e1) {
e1.printStackTrace();
} catch (javax.crypto.NoSuchPaddingException e2) {
e2.printStackTrace();
} catch (java.lang.Exception e3) {
e3.printStackTrace();
}
return null;
}