Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String AES_decrypt(String inputMessage, String key) throws CryptoException, IOException,
- CryptoTokenException, CryptoUnsupportedOperationException {
- AESKey aeskey = new AESKey(key.getBytes());
- byte[] data = StringUtil.b64_decode(inputMessage);
- AESDecryptorEngine engine = new AESDecryptorEngine(aeskey);
- PKCS5UnformatterEngine uengine = new PKCS5UnformatterEngine(engine);
- ByteArrayInputStream input = new ByteArrayInputStream(data);
- BlockDecryptor decryptor = new BlockDecryptor(uengine, input);
- decryptor.read(data);
- decryptor.close();
- input.close();
- return input.toString();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement