AESCipherText
classin packageklyn.cryptography
public class AESCipherText extends Object:
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 |
Ciphertext in Base64. |
| public readonly |
cipherTextHex |
Ciphertext in hexadecimal. |
| public readonly |
ivBase64 |
Initialization vector in Base64. |
| public readonly |
ivHex |
Initialization vector in hexadecimal. |
| public readonly |
keySizeBits |
AES key size in bits. |
| public readonly |
mode |
AES mode used to encrypt the payload. |
| public readonly |
tagBase64 |
Authentication tag in Base64. |
| public readonly |
tagHex |
Authentication tag in hexadecimal. |
| public readonly |
transformation |
Concrete OpenSSL transformation name. |
Properties
| Modifier and Type |
Member |
Description |
| public readonly property |
authenticated |
Returns true when the payload carries an authentication tag. |
Constructors
| Modifier and Type |
Member |
Description |
| public |
AESCipherText |
Creates an AES payload object. |
Methods
| Modifier and Type |
Member |
Description |
| public static |
fromMap |
Rebuilds an AES payload from a serialized map. |
| public |
toMap |
Converts this payload to a serializable map. |
| public override |
toString |
No summary. |