Crypto Lib
    Preparing search index...

    Class SymmetricRatchet

    A KDF chain that produces message keys from a chain key.

    Each call to next() advances the chain and returns a message key, providing forward secrecy at the symmetric level.

    Index
    • Create a symmetric ratchet from a chain key and optional starting index.

      Parameters

      • chainKey: string | Uint8Array<ArrayBufferLike>
      • index: number = 0

      Returns SymmetricRatchet

    • Advance the chain, producing a message key and updated chain key.

      Uses HMAC-SHA256 with different constants for message key vs chain key derivation (standard Signal approach).

      Returns { messageKey: Uint8Array; index: number }

      • messageKey: Uint8Array

        Derived per-message encryption key.

      • index: number

        Message index in the chain.