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

Convenience AES-GCM decryption helper.

Parameters
ParameterDescription
payloadStructured AES-GCM payload.
keyAES key material.
keyEncodingKey encoding. Defaults to base64.
aadOptional additional authenticated data.
Returns

Decrypted UTF-8 text.

Throws
  • CryptoException on authentication or decryption failure.
Example
import klyn.cryptography

key = AESKeyGenerator().generateKey()
payload = Cipher.aesGcmEncrypt("hello", key)
print(Cipher.aesGcmDecrypt(payload, key))