Code example for CipherOutputStream

Methods: closewrite

			SecretKeySpec scs = new SecretKeySpec(key, "AES");
			Cipher cipher = Cipher.getInstance("AES/CFB/NoPadding", "ZBC");
			IvParameterSpec iv = new IvParameterSpec(initVector);
			cipher.init(Cipher.ENCRYPT_MODE, scs, iv);
			ByteArrayOutputStream baos = new ByteArrayOutputStream(data.length);
			CipherOutputStream out = new CipherOutputStream(baos, cipher);
			out.write(data, 0, data.length);
			return baos.toByteArray();
		} catch (Exception e) {
			throw new CryptoException(e);
	/* (non-Javadoc) 
	 * @see zorg.platform.CryptoUtils#calculateSHA256HMAC(byte[], int, int, byte[]) 
	public byte[] calculateSHA256HMAC(byte[] data, int offset, int length,
Connect your IDE to all the code out there  Get Codota for Java