klyn.cryptography.Cipher.aesCtrDecrypt
method
public static aesCtrDecrypt(payload as AESCipherText, key as String, keyEncoding as String = "base64") as String throws CryptoException:
Description

Convenience AES-CTR decryption helper.

Parameters
ParameterDescription
payloadStructured AES-CTR payload.
keyAES key material.
keyEncodingKey encoding. Defaults to base64.
Returns

Decrypted UTF-8 text.

Throws
  • CryptoException when decryption fails.
Example
import klyn.cryptography

key = AESKeyGenerator().generateKey()
payload = Cipher.aesCtrEncrypt("hello", key)
print(Cipher.aesCtrDecrypt(payload, key))