Skip to content

Instantly share code, notes, and snippets.

@Jaymo
Created February 29, 2016 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jaymo/6516a86c4223b9f276e7 to your computer and use it in GitHub Desktop.
Save Jaymo/6516a86c4223b9f276e7 to your computer and use it in GitHub Desktop.
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