This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Java: | |
String encrypt(String inputString) { | |
IvParameterSpec ivSpec = new IvParameterSpec("c1234567-zipl-03".getBytes()); | |
SecretKeySpec keySpec = new SecretKeySpec("GeN8IfCrdxKxMxFA".getBytes(), "AES"); | |
Cipher cipher; | |
try { | |
cipher = Cipher.getInstance("AES/CBC/NoPadding"); | |
cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivSpec); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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())); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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())); |