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

Related

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