Skip to content

Instantly share code, notes, and snippets.

@jetrubyshared
Created October 31, 2018 15:04
Show Gist options
  • Save jetrubyshared/2918fe3556600af7e326776844873a2c to your computer and use it in GitHub Desktop.
Save jetrubyshared/2918fe3556600af7e326776844873a2c to your computer and use it in GitHub Desktop.
private static String decryptString(String string, Cipher cipher) {
try {
byte[] bytes = Base64.decode(string, Base64.NO_WRAP);
return new String(cipher.doFinal(bytes));
} catch (IllegalBlockSizeException | BadPaddingException exception) {
exception.printStackTrace();
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment