/**
* 解密
*/
private byte[] decode(byte[] pBytes) throws Exception {
Cipher mCipher = Cipher.getInstance("DES");
mCipher.init(Cipher.DECRYPT_MODE,"密钥串");
return mCipher.doFinal(pBytes);
}
/**
* 加密
*/
private byte[] encode(byte[] pBytes) throws Exception {
Cipher mCipher = Cipher.getInstance("DES");
mCipher.init(Cipher.ENCRYPT_MODE,"密钥串");
return mCipher.doFinal(pBytes);
}
java文件传输加解密
最新推荐文章于 2024-08-12 16:25:56 发布