This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; | |
random.nextBytes(iv); | |
return iv; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment