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

Parameter | Description
--- | ---
`payload` | Structured AES-CTR payload.
`key` | AES key material.
`keyEncoding` | Key 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))