Skip to content

noqtis-dec(1)

noqtis-dec — decapsulate an ML-KEM or HQC shared secret

noqtis dec -k key -o ss | --stdout [-f | --force] ct

noqtis dec recovers the shared secret from the ciphertext ct with the secret KEM key in key, and writes its 32 bytes to ss (created owner-only, mode 0600) or prints them in hex with --stdout. Exactly one of the two must be given.

A ciphertext of the right length that was changed in transit is not an error: as FIPS 203 and HQC require (implicit rejection), it gives an unrelated pseudorandom secret and exit status 0. Whether the secrets agree shows only when they are used, for example when an authenticated cipher keyed from them fails. A ciphertext of the wrong length is refused (exit 2).

key, --key=key
A secret KEM key file.
ss, --out=ss
The shared-secret file.
Print the secret in hex instead.
, --force
Replace an existing ss.

0 on success (including implicit rejection); 2 on a usage error, a key that is not a secret KEM key, a ciphertext of the wrong length, or a file that cannot be read or written.

$ noqtis dec -k box -o receiver.ss msg.ct
$ noqtis dec -k box --stdout msg.ct | wc -c
65

noqtis(1), noqtis-enc(1), nqenc(3)