Skip to content

Instantly share code, notes, and snippets.

@d0nutptr
Created July 4, 2017 00:49
Show Gist options
  • Save d0nutptr/3bc12279d66838a2fa792734659086ee to your computer and use it in GitHub Desktop.
Save d0nutptr/3bc12279d66838a2fa792734659086ee to your computer and use it in GitHub Desktop.
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] cipherText = cipher.doFinal(plainText);
byte[] nonce = cipher.getIV();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment