Crypto Lib
    Preparing search index...

    Function sealPQ

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

      The sender generates an ephemeral X25519 key pair and an ephemeral ML-KEM-768 encapsulation. Both shared secrets are combined via HKDF-SHA256 to derive the encryption 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