public static aesCtrEncrypt(plainText as String, key as String, keyEncoding as String = "base64", iv as String = null, ivEncoding as String = "base64") as AESCipherText throws CryptoException:
Convenience AES-CTR encryption helper.
| Parameter | Description |
|---|---|
plainText | Source text interpreted as UTF-8. |
key | AES key material. |
keyEncoding | Key encoding. Defaults to base64. |
iv | Optional IV. |
ivEncoding | IV encoding when iv is provided. |
Structured AES-CTR payload.
import klyn.cryptography
key = AESKeyGenerator().generateKey()
payload = Cipher.aesCtrEncrypt("hello", key)
print(payload.cipherTextHex)