noqtis-sign(1)
NAME
noqtis-sign — sign
a file with ML-DSA or SLH-DSA
SYNOPSIS
noqtis sign |
-k key
[-o sig]
[-c ctx]
[-d] [--ph
hash] [-f |
--force] file |
DESCRIPTION
noqtis sign signs the bytes of
file with the secret key in key
and writes the raw signature (the FIPS 204 or FIPS 205 encoding, no header)
to sig, by default
file.sig. It prints nothing on
success. file may be
‘-’ for standard input, and then
-o is required.
Signing is hedged by default: fresh randomness from the operating system is mixed into each signature, so two signatures of one file differ.
When the public key file key.pub is beside the secret key, the new signature is checked with it before anything is written: a signature that does not verify (a public key that is not the pair of key, or a fault while signing) is not written and the exit status is 2. Without that file the signature is written unchecked.
-kkey,--key=key- A secret signature key file (‘
noqtis-key-1 <alg> sec’). A KEM key is refused. -osig,--out=sig- Where to write the signature.
-cctx,--ctx=ctx- The FIPS 204/205 context string: the bytes of the argument, at most 255. The same context must be given to noqtis-verify(1). Default: empty.
-d,--det- Deterministic signing: the per-signature randomness is all zero (32 bytes for ML-DSA, n bytes for SLH-DSA), so the same key, file and options give the same signature.
--phhash- The pre-hash variant (HashML-DSA, HashSLH-DSA): the file is hashed with
hash and the digest is signed together with the
hash's identifier. hash is one of
sha224 sha256 sha384 sha512 sha512-224 sha512-256sha3-224 sha3-256 sha3-384 sha3-512 shake128 shake256. A pre-hash signature verifies only with the same--ph. -f,--force- Replace an existing signature file.
A file over 1 GiB is refused. A file that is a capsule manifest (noqtis.json) is signed as given, with a warning: a plain signature is never a seal (seals are made with their own context; see noqtis-capsule(5)), so to seal a folder use noqtis-seal(1).
EXIT STATUS
0 on success; 2 on a usage error, a context over 255 bytes, an
unknown pre-hash, a key that is not a secret signature key, an existing
sig without --force, or a file
that cannot be read or written.
EXAMPLES
$ noqtis keygen -a ML-DSA-65 -o me ML-DSA-65 key pair: me (secret), me.pub (public) $ noqtis sign -k me report.pdf $ noqtis verify -p me.pub -s report.pdf.sig report.pdf report.pdf: OK (ML-DSA-65)
With a context string, deterministically, and from standard input:
$ noqtis sign -k me -c release-2026 -d -o notes.sig - < notes.txt $ noqtis verify -p me.pub -s notes.sig -c release-2026 notes.txt notes.txt: OK (ML-DSA-65)
HashML-DSA with SHA-512:
$ noqtis sign -k me --ph sha512 -o big.sig big.tar $ noqtis verify -p me.pub -s big.sig --ph sha512 big.tar big.tar: OK (ML-DSA-65)