AESCipherText
class in package klyn.cryptography

    public class AESCipherText extends Object:

Object
└ AESCipherText

Structured AES encryption payload.

The payload is intentionally text-friendly and exposes both Base64 and hex representations for the generated IV, ciphertext and authentication tag.

    import klyn.cryptography

    key = AESKeyGenerator().generateKey()
    encrypted = Cipher.aesEncrypt("secret", key)
    print(encrypted.cipherTextBase64)

Fields

Modifier and Type | Member | Description
--- | --- | ---
public readonly | cipherTextBase64 `cipherTextBase64 as String` | Ciphertext in Base64.
public readonly | cipherTextHex `cipherTextHex as String` | Ciphertext in hexadecimal.
public readonly | ivBase64 `ivBase64 as String` | Initialization vector in Base64.
public readonly | ivHex `ivHex as String` | Initialization vector in hexadecimal.
public readonly | keySizeBits `keySizeBits as Int` | AES key size in bits.
public readonly | mode `mode as String` | AES mode used to encrypt the payload.
public readonly | tagBase64 `tagBase64 as String` | Authentication tag in Base64.
public readonly | tagHex `tagHex as String` | Authentication tag in hexadecimal.
public readonly | transformation `transformation as String` | Concrete OpenSSL transformation name.

Properties

Modifier and Type | Member | Description
--- | --- | ---
public readonly property | authenticated `authenticated as Boolean:` | Returns true when the payload carries an authentication tag.

Inherited Properties
property Inherited Properties from Object: type
Constructors

Modifier and Type | Member | Description
--- | --- | ---
public | AESCipherText `AESCipherText(mode as String, transformation as String, keySizeBits as Int, ivBase64 as String, ivHex as String, cipherTextBase64 as String, cipherTextHex as String, tagBase64 as String, tagHex as String):` | Creates an AES payload object.

Methods

Modifier and Type | Member | Description
--- | --- | ---
public static | fromMap `fromMap(value as Map<String, Object>) as AESCipherText:` | Rebuilds an AES payload from a serialized map.
public | toMap `toMap() as Map<String, Object>:` | Converts this payload to a serializable map.
public override | toString `toString() as String:` | No summary.

Inherited Methods
method Inherited Methods from Object: deepCopy, fromJson, toDict, toJson, toString, toXml