Code example for Cipher

Methods: doFinalinit

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);
	} 
} 
Contextual code suggestions in your IDE  Get Codota for Java