Here you can find the source of generateIV()
public static byte[] generateIV()
//package com.java2s; /**/* ww w. j av a 2 s .co m*/ * Copyright (c) 2005-2012 springside.org.cn * * Licensed under the Apache License, Version 2.0 (the "License"); */ import java.security.SecureRandom; public class Main { private static final int DEFAULT_IVSIZE = 16; private static SecureRandom random = new SecureRandom(); public static byte[] generateIV() { byte[] bytes = new byte[DEFAULT_IVSIZE]; random.nextBytes(bytes); return bytes; } }