Here you can find the source of generateIV()
public static byte[] generateIV()
//package com.java2s; //License from project: Open Source License import java.security.SecureRandom; public class Main { public static byte[] generateIV() { SecureRandom random = new SecureRandom(); byte[] iv = new byte[16]; random.nextBytes(iv);/* w ww . j ava 2 s .c om*/ return iv; } }