AES with variables
The FIPS 197 AES-128 example whose key and plaintext come from named variables of the Value Registry instead of constants.
Overview & Cryptographic Context
In larger cryptographic test suites, hardcoding literal hex keys and test payloads inside individual nodes makes switching between environments or test vectors tedious and error-prone. NodeCrypto provides a Value Registry where named variables (such as $example.aes.key and $example.aes.plaintext) are stored separately from the workflow graph and resolved at execution time.
This workflow reproduces the canonical NIST FIPS 197 Appendix C.1 (AES-128) single-block test vector. Instead of storing literal byte strings in the two Static Value nodes, their valueBytes properties hold {"$var": "$example.aes.key"} and {"$var": "$example.aes.plaintext"} references.
Pipeline Architecture & Wiring Flow
- Variable Resolution (
Static Value× 2): Before executing the graph, the runtime looks up$example.aes.key(000102030405060708090a0b0c0d0e0f) and$example.aes.plaintext(00112233445566778899aabbccddeeff) in the Value Registry and emits their 16-byte values on theValueoutput ports. - Block Encryption (
AES Encrypt): Runs AES-128 inECBmode withpadding = "None"to produce the 16-byte FIPS 197 ciphertext block on itsciphertextoutput port.
Nodes & Configuration
| Node | Node Role & Key Parameters | Count |
|---|---|---|
| Static Value | Two instances labeled Key ($example.aes.key) and Plaintext ($example.aes.plaintext) | 2 |
| AES Encrypt | Labeled AES-128-ECB; configured with mode = "ECB", padding = "None" | 1 |
Variables, Outputs & Test Vector Verification
Verification Source: FIPS 197 Appendix C.1 (AES-128 example vector)
Value Registry Variables
| Variable Name | Type | Resolved Value (Hex) |
|---|---|---|
$example.aes.key | bytes (16 B) | 000102030405060708090a0b0c0d0e0f |
$example.aes.plaintext | bytes (16 B) | 00112233445566778899aabbccddeeff |
Expected Outputs
| Node Output | Type | Value (Hex) |
|---|---|---|
AES-128-ECB.ciphertext | bytes (16 B) | 69c4e0d86a7b0430d8cdb78070b4c55a |