Asymmetric + KDF · Port Naming RFC 7748 + RFC 5869 Self-Documenting Graph

X25519 + HKDF with port names

The same session-key derivation with role names on the fixed ports of both nodes.

Open in app Download .ncw

Overview & Cryptographic Context

When chaining key agreement into key derivation, renaming the ports on both nodes makes the security boundary between the non-uniform raw ECDH output and the uniform HKDF session key immediately explicit on the canvas. This workflow is functionally identical to X25519 + HKDF, but customizes port names and attaches Markdown memos on both nodes.

Specifically, the output of X25519 Key Exchange (ECDH) (port ID sharedSecret) and the input of HKDF Key Derivation (port ID ikm) are both given the display name Raw Shared Secret, while HKDF's okm output is renamed to Session Key.

Pipeline Architecture & Role Port Mapping

Workflow Input ──► X25519 ECDH (Raw Shared Secret) ──► HKDF (Raw Shared Secret → Session Key) ──► Workflow Output

Nodes & Configuration

NodeNode Role & Renamed PortsCount
Workflow InputSupplies PrivateKey, PeerPublicKey, Salt, and Info1
X25519 Key Exchange (ECDH)Outputs Raw Shared Secret (port ID sharedSecret)1
HKDF Key DerivationhashAlgorithm = "SHA-256", keyLength = 32; outputs Session Key (port ID okm)1
Workflow OutputCollects the 32-byte SessionKey1

Node reference → · Port renaming guide →

Inputs, Outputs & Test Vector Verification

Verification Source: RFC 7748 §6.1 shared secret; HKDF-SHA-256 output cross-checked with Node.js crypto.hkdfSync

Inputs

NameTypeValue (Hex)
PrivateKeybytes (32 B)77076d0a7318a57d3c16c17251b26645df4c2f87ebc0992ab177fba51db92c2a
PeerPublicKeybytes (32 B)de9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f
Saltbytes (13 B)000102030405060708090a0b0c
Infobytes (22 B)6e6f646563727970746f2073657373696f6e206b6579

Expected Outputs

NameTypeValue (Hex)
SessionKeybytes (32 B)7d87f69eef5eee6ad11c518723db4f5f8708a99c84e9a3589df85d62d7b14c9b