c 中openssl aes 加密对应java 方法
public static byte[] Encrypt(byte[] bArr, byte[] bArr2) {
try {
SecretKey generateSecret = SecretKeyFactory.getInstance("DESede").generateSecret(new DESedeKeySpec(bArr2));
Cipher instance = Cipher.getInstance("DESede/ECB/PKCS5Padding");
instance.init(1, generateSecret);
return instance.doFinal(bArr);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
life is a jounery,yes