byte数组加密解密
/** * 解密 */private byte[] decode(byte[] pBytes) throws Exception {Cipher mCipher = Cipher.getInstance("DES");mCipher.init(Cipher.DECRYPT_MODE, 获取key);return mCipher.doFinal(pBytes);}/** * 加密 */private byte[] encode(byte[] pBytes) throws Exception {Cipher mCipher = Cipher.getInstance("DES");mCipher.init(Cipher.ENCRYPT_MODE, 获取key);return mCipher.doFinal(pBytes);}
页:
[1]