Here you can find the source of generateIV(byte[] iv)
private static AlgorithmParameters generateIV(byte[] iv) throws Exception
//package com.java2s; //License from project: Apache License import java.security.AlgorithmParameters; import javax.crypto.spec.IvParameterSpec; public class Main { private static AlgorithmParameters generateIV(byte[] iv) throws Exception { AlgorithmParameters params = AlgorithmParameters.getInstance("AES"); params.init(new IvParameterSpec(iv)); return params; }//from ww w .jav a 2 s.c o m }