Skip to content

Instantly share code, notes, and snippets.

@Jaymo
Created February 29, 2016 10:22
Embed
What would you like to do?
public static Cipher createCipher(int mode,SecretKey key,String iv) throws Exception {
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding", "BC");
cipher.init(
Cipher.DECRYPT_MODE,
new SecretKeySpec(key, "AES"),
new IvParameterSpec(Util.HexEncoder.toByte(iv))
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment