Skip to content

Instantly share code, notes, and snippets.

Created February 29, 2016 08:22
What would you like to do?
private static final String RANDOM_ALGORITHM = "SHA1PRNG";
public static final int IV_LENGTH = 16;
private byte[] generateIv() throws NoSuchAlgorithmException, NoSuchProviderException {
SecureRandom random = SecureRandom.getInstance(RANDOM_ALGORITHM);
byte[] iv = new byte[IV_LENGTH];
return iv;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment