Code example for Cipher

Methods: doFinal, init

0
	} 
 
	@Override 
	public void encrypt(byte[] aIV, byte[] buffer) throws CryptoException {
		try { 
			cipher.init(Cipher.ENCRYPT_MODE, scs, iv);
			byte[] res = cipher.doFinal(aIV);
			System.arraycopy(res, 0, buffer, 0, res.length);
		} catch (Exception e) {
			throw new CryptoException(e);
		} 
	} 
 
	@Override 
	public byte[] encryptIV_for_prf(byte[] IV) throws CryptoException {
		try { 
			Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding", "ZBC");
			cipher.init(Cipher.ENCRYPT_MODE, scs, iv);
			return cipher.doFinal(IV, 0, 16);
		} catch (Exception e) {
			throw new CryptoException(e);