Examples
Example keys and passwords are public test material.
basic encryption
Input
HelloExpected answer
af14bce6b9b6588c3aa63f9ddc5a0cf5f565f358b0af14bce6b9b6588c3aa63f9ddc5a0cf5f565f358b0
- Key
{"option":"Hex","string":"000102030405060708090a0b0c0d0e0f"}- Nonce
{"option":"Hex","string":"000102030405060708090a0b0c0d0e0f"}- Associated Data
{"option":"Hex","string":""}- Input
Raw- Output
Hex
invalid key length
Input
test messageExpected rejection
Message containsInvalid key length: 8 bytes.
Ascon-AEAD128 requires a key of exactly 16 bytes (128 bits).- Key
{"option":"Hex","string":"0001020304050607"}- Nonce
{"option":"Hex","string":"000102030405060708090a0b0c0d0e0f"}- Associated Data
{"option":"Hex","string":""}- Input
Raw- Output
Hex
invalid nonce length
Input
test messageExpected rejection
Message containsInvalid nonce length: 12 bytes.
Ascon-AEAD128 requires a nonce of exactly 16 bytes (128 bits).- Key
{"option":"Hex","string":"000102030405060708090a0b0c0d0e0f"}- Nonce
{"option":"Hex","string":"000102030405060708090a0b"}- Associated Data
{"option":"Hex","string":""}- Input
Raw- Output
Hex
longer message
Input
test messageExpected answer
9314a3fef6cc299a07b8c9e0f9e479ca0d1187e87345cf590adc572b9314a3fef6cc299a07b8c9e0f9e479ca0d1187e87345cf590adc572b
- Key
{"option":"Hex","string":"000102030405060708090a0b0c0d0e0f"}- Nonce
{"option":"Hex","string":"000102030405060708090a0b0c0d0e0f"}- Associated Data
{"option":"Hex","string":""}- Input
Raw- Output
Hex
NIST KAT (PT=16 bytes, AD=16 bytes)
Input
!"#$%&'()*+,-./Expected answer
6373ebb28be97c9bac090cf399c13ef13abfc0d209e8f4844c90814d13f32c596373ebb28be97c9bac090cf399c13ef13abfc0d209e8f4844c90814d13f32c59
- Key
{"option":"Hex","string":"000102030405060708090a0b0c0d0e0f"}- Nonce
{"option":"Hex","string":"101112131415161718191a1b1c1d1e1f"}- Associated Data
{"option":"Hex","string":"303132333435363738393a3b3c3d3e3f"}- Input
Raw- Output
Hex
NIST KAT Count=34 (PT=0x20, empty AD)
Input
Expected answer
e8dd576aba1cd3e6fc704de02aedb79588e8dd576aba1cd3e6fc704de02aedb79588
- Key
{"option":"Hex","string":"000102030405060708090a0b0c0d0e0f"}- Nonce
{"option":"Hex","string":"101112131415161718191a1b1c1d1e1f"}- Associated Data
{"option":"Hex","string":""}- Input
Raw- Output
Hex
NIST KAT Count=341 (PT=10 bytes, AD=10 bytes)
Input
!"#$%&'()Expected answer
12042996da42b4536e5a0e64692cf6041ff8c367e1423253c84c12042996da42b4536e5a0e64692cf6041ff8c367e1423253c84c
- Key
{"option":"Hex","string":"000102030405060708090a0b0c0d0e0f"}- Nonce
{"option":"Hex","string":"101112131415161718191a1b1c1d1e1f"}- Associated Data
{"option":"Hex","string":"30313233343536373839"}- Input
Raw- Output
Hex
no key
Input
test messageExpected rejection
Message containsInvalid key length: 0 bytes.
Ascon-AEAD128 requires a key of exactly 16 bytes (128 bits).- Key
{"option":"Hex","string":""}- Nonce
{"option":"Hex","string":"000102030405060708090a0b0c0d0e0f"}- Associated Data
{"option":"Hex","string":""}- Input
Raw- Output
Hex
no nonce
Input
test messageExpected rejection
Message containsInvalid nonce length: 0 bytes.
Ascon-AEAD128 requires a nonce of exactly 16 bytes (128 bits).- Key
{"option":"Hex","string":"000102030405060708090a0b0c0d0e0f"}- Nonce
{"option":"Hex","string":""}- Associated Data
{"option":"Hex","string":""}- Input
Raw- Output
Hex
with associated data
Input
HelloExpected answer
351880c09f9dee12c20c4ba973066bc10dd26000b6351880c09f9dee12c20c4ba973066bc10dd26000b6
- Key
{"option":"Hex","string":"000102030405060708090a0b0c0d0e0f"}- Nonce
{"option":"Hex","string":"000102030405060708090a0b0c0d0e0f"}- Associated Data
{"option":"UTF8","string":"metadata"}- Input
Raw- Output
Hex
Key: Must be exactly 16 bytes (128 bits). Nonce: Must be exactly 16 bytes (128 bits). Should be unique for each encryption with the same key. Never reuse a nonce with the same key. Associated Data: Optional additional data that is authenticated but not encrypted. Useful for including metadata like headers or timestamps. The output includes both the ciphertext and a 128-bit authentication tag.
Format reference: Ascon Encrypt background and specification