Here you can find the source of generateIV()
public static byte[] generateIV()
//package com.java2s; //License from project: Apache License import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; public class Main { public static byte[] generateIV() { byte iv[] = new byte[16]; try {/* ww w .j ava 2s.c om*/ SecureRandom randomSecureRandom = SecureRandom.getInstance("SHA1PRNG"); randomSecureRandom.nextBytes(iv); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } return iv; } }