有和java通用的des加密吗?
java代码:
private static final String DES = "DES";
private static final String MODEL = "DES/CBC/PKCS5Padding";
public static String encryptDES(String encrypeString, String encrypetKey) {
byte[] encryptedData = null;
try {
IvParameterSpec zeroIv = new IvParameterSpec(IV);
SecretKeySpec key = new SecretKeySpec(encrypetKey.getBytes(), DES);
Cipher cipher = Cipher.getInstance(MODEL);
cipher.init(Cipher.ENCRYPT_MODE, key, zeroIv);
encryptedData = cipher.doFinal(encrypeString.getBytes());
} catch (Exception e) {
e.printStackTrace();
}
return Base64.encode(encryptedData);
}
delphi要怎么弄 找了好几个都不行