Code example for Cipher

Methods: doFinal, init

0
		cipher.init(Cipher.ENCRYPT_MODE, key);
		return cipher.doFinal(data);
	} 
	 
	public synchronized byte[] decrypt(byte[] data) throws InvalidKeyException, BadPaddingException, IllegalBlockSizeException {
		cipher.init(Cipher.DECRYPT_MODE, key);
		return cipher.doFinal(data);
	} 
}