Hubert - Distributed Infrastructure for Secure Multiparty Transactions - v1.0.0-alpha.20
    Preparing search index...

    Function deriveKey

    • Derive a deterministic key from an ARID using a specific salt.

      Uses HKDF to derive key material from the ARID, ensuring that:

      • Same ARID always produces same key for a given salt
      • Keys are cryptographically derived (not guessable)
      • Collision resistance inherited from ARID
      • No identifying information in the key (fully anonymized)

      Port of derive_key() from arid_derivation.rs lines 8-29.

      Parameters

      • salt: Uint8Array

        Domain-specific salt to ensure different backends derive different keys

      • arid: ARID

        The ARID to derive from

      • outputLen: number

        Length of output in bytes (typically 20 or 32)

      Returns Uint8Array

      Derived key bytes

      const key = deriveKey(new TextEncoder().encode("my-salt"), arid, 32);