Symmetric · Value Registry $var Reference FIPS 197 App. C.1 Verified

AES with variables

The FIPS 197 AES-128 example whose key and plaintext come from named variables of the Value Registry instead of constants.

Open in app Download .ncw

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

Static Value ($example.aes.key) ──► AES Encrypt (AES-128-ECB) ◄── Static Value ($example.aes.plaintext)
  1. 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 the Value output ports.
  2. Block Encryption (AES Encrypt): Runs AES-128 in ECB mode with padding = "None" to produce the 16-byte FIPS 197 ciphertext block on its ciphertext output port.

Nodes & Configuration

NodeNode Role & Key ParametersCount
Static ValueTwo instances labeled Key ($example.aes.key) and Plaintext ($example.aes.plaintext)2
AES EncryptLabeled AES-128-ECB; configured with mode = "ECB", padding = "None"1

Node reference →

Variables, Outputs & Test Vector Verification

Verification Source: FIPS 197 Appendix C.1 (AES-128 example vector)

Value Registry Variables

Variable NameTypeResolved Value (Hex)
$example.aes.keybytes (16 B)000102030405060708090a0b0c0d0e0f
$example.aes.plaintextbytes (16 B)00112233445566778899aabbccddeeff

Expected Outputs

Node OutputTypeValue (Hex)
AES-128-ECB.ciphertextbytes (16 B)69c4e0d86a7b0430d8cdb78070b4c55a