Skip to content

Instantly share code, notes, and snippets.

@Honigbaum
Created September 25, 2012 14:44
Show Gist options
  • Save Honigbaum/3782352 to your computer and use it in GitHub Desktop.
Save Honigbaum/3782352 to your computer and use it in GitHub Desktop.
Encryption
IvParameterSpec ivSpec = new IvParameterSpec("c1234567-zipl-03".getBytes());
SecretKeySpec keySpec = new SecretKeySpec("GeN8IfCrdxKxMxFA".getBytes(), "AES");
Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivSpec);
return "1" + bytesToHex(cipher.doFinal("Test".getBytes()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment