Java IV Generate generateIV()

Here you can find the source of generateIV()

Description

generate IV

License

Apache License

Declaration

public static byte[] generateIV() 

Method Source Code

//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;
    }
}

Related

  1. generateIV()
  2. generateIV()
  3. generateIV()
  4. generateIV()
  5. generateIV(byte[] iv)