Crypto Lib
    Preparing search index...

    Function sealPQ

    • Encrypt plaintext to a recipient using both X25519 and ML-KEM-768.

      The sender encapsulates to both keys with the library's v2 hybrid KEM (see modern/hybrid-combiner.ts), which binds both ciphertexts and both public keys, and derives the encryption key from its secret with the label crypto-service/sealed-box/v2. openPQ also opens boxes sealed before, whose key bound only the ephemeral key.

      Output format: ephemeral_x25519_pub (32 B) || ml_kem_ciphertext (1088 B) || nonce (24 B) || ciphertext || tag (16 B)

      Parameters

      • recipientX25519Public: string | Uint8Array<ArrayBufferLike>

        Recipient's X25519 public key (hex, 32 bytes).

      • recipientMlKemPublic: string | Uint8Array<ArrayBufferLike>

        Recipient's ML-KEM-768 public key (hex).

      • plaintext: string | Uint8Array<ArrayBufferLike>

        Data to encrypt.

      Returns PqSealedBoxResult