Skip to content

Verifying the Image

Sam Bent edited this page Nov 17, 2026 · 23 revisions

Verifying the Image

You're about to run software that protects where you are. You shouldn't have to trust that the image on the registry is really the one built from the public source. This page shows how to check.

There are two independent things you can verify: that the image was signed by the maintainer, and that it was built from the public source and nothing else.

Where to get it

The image is published to two registries:

docker pull sambent.dev/sam/hiddenforge:3.0.1   # the maintainer's own registry
docker pull doingfedtime/hiddenforge:3.0.1      # Docker Hub

Both serve the identical index (sha256:a267ae01f604b0c5a6a125972cb6d92ccfdb9a9f8e9240ab709108baafc09b76 for 3.0.1, covering linux/amd64 and linux/arm64), and the signature below verifies either one. If they ever disagree, that is exactly the kind of thing this page exists to catch: stop and ask.

The digest, not the tag, is what the signatures are over. Check which digest you received:

skopeo inspect --raw docker://sambent.dev/sam/hiddenforge:3.0.1 | sha256sum
# or
docker buildx imagetools inspect sambent.dev/sam/hiddenforge:3.0.1 | head -3

It must equal the contents of signatures/hiddenforge.digest on master in the code repository (sha256sum prints the bare hex; the file has a sha256: prefix).

1. Check the signatures

The release digest is signed with ML-DSA-65, and a release may also carry a hardware-key (SSH-FIDO2) signature. Neither depends on an outside transparency log or third-party service. The verification material lives in the signatures/ folder of the code repository.

The one-command check

The hiddenforge CLI (scripts/hiddenforge in the repository, Python 3.10 or later) does the digest check and the signature checks together. Run it from the root of a clone of the repository, where it reads signatures/, or point it there with --sigdir:

git clone https://sambent.dev/sam/HiddenForge.git && cd HiddenForge
scripts/hiddenforge verify-image sambent.dev/sam/hiddenforge:3.0.1 --allow-pq-only --json

It reads the registry digest with skopeo, so install that first; without it the check fails with "could not resolve registry digest". --skip-registry checks the signatures alone.

If you pin the image by digest (sambent.dev/sam/hiddenforge@sha256:...), the CLI compares that digest with the signed digest on every run, including with --skip-registry, and refuses a reference pinned to any other digest. Before 3.0.0, --skip-registry ignored the digest after the @ and answered ok.

Verify from master, not from the tag. signatures/ on master holds the latest release's signatures. A release's signatures are committed after its tag (the digest depends on the tagged commit), so a checkout of a tag carries the release before it: v3.0.1 still holds the 3.0.0 signature files, which do not match the 3.0.1 digest. That mismatch means "look on master", not "tampered with". To verify an older release, check out the commit that added its signatures (git log -- signatures/hiddenforge.digest), not its tag.

It verifies against release keys pinned inside the CLI, never against keys it finds in the signatures/ folder, and it fails (exit 1) if either half of the signature cannot be checked, unless you accept that explicitly: --allow-classical-only when the post-quantum half is missing, --allow-pq-only when the hardware half is. Either way the result says complete: false. A signature that is present but wrong is never excused.

3.0.0, 3.0.1 and 2.1.0 to 2.1.6 are signed with ML-DSA-65 only. There is no hiddenforge.digest.sig for them, so verify with --allow-pq-only (the result says complete: false) and use the ML-DSA check below. A hardware signature may be added later over the same digest, which would not need a new image. The signing key is a file on the maintainer's workstation, so for these releases the reproducible build below is the second check: do not rely on the signature alone.

Check the keys first

A signature file verifies against whatever public key sits beside it. Someone able to replace the signatures could replace the keys next to them too, so the keys are the trust anchor. Before trusting the manual commands below, confirm the key files match these values (the same ones pinned in the CLI and printed in the README):

ssh-keygen -lf allowed-signers   # SHA256:YcUo1tBtj+Mlnpv9QpsWnJcMt77B4SipyD6OWSMjMB4
                                 # SHA256:wL6piZbyXpTOzT7Z66f/Q+vegj0Ml0ZwVouGJ06+3Q0
sha256sum sambent-mldsa.pub      # 4ae873ade7ee596c815f55f3052c0f01020b1817f86eaf15ab67c8fc77cbfd22

Compare them against a copy you got some other way (an earlier download, a trusted contact) rather than only against this page.

Post-quantum signature (ML-DSA-65)

ML-DSA-65 is standardized for the era of quantum computers (FIPS 204). Stock OpenSSL 3.5 or later verifies it; older OpenSSL has no ML-DSA. The key and signature files carry a 16-byte header in front of the standard encoding, which the first two lines strip. Run this inside signatures/:

# ML-DSA-65 with stock OpenSSL 3.5 or later (strip pqsign's 16-byte headers,
# wrap the raw key as a SubjectPublicKeyInfo, verify)
tail -c +17 sambent-mldsa.pub > /tmp/mldsa.key
tail -c +17 hiddenforge.digest.mldsa > /tmp/mldsa.sig
{ printf '\060\202\007\262\060\013\006\011\140\206\110\001\145\003\004\003\022\003\202\007\241\000'
  cat /tmp/mldsa.key; } > /tmp/mldsa.der
openssl pkeyutl -verify -pubin -keyform DER -inkey /tmp/mldsa.der \
  -in hiddenforge.digest -sigfile /tmp/mldsa.sig

It prints Signature Verified Successfully.

Hardware key (YubiKey / SSH-FIDO2)

This signature is made by a physical security key, so it can't be produced by software alone, not even by someone who has stolen the maintainer's disk. 3.0.1 does not carry one (hiddenforge.digest.sig is not published for it; see the note above). When a release does, check it with:

ssh-keygen -Y verify \
  -f allowed-signers \
  -I sam@sambent.com \
  -n file \
  -s hiddenforge.digest.sig \
  < hiddenforge.digest

When both are present they sign the same image digest and cover different kinds of risk: a future quantum attack, and impersonation without the hardware token.

A note on cosign, and on the signing key

Releases up to 2.0.3 additionally carried a cosign signature. From 2.0.4 cosign is no longer used: it was the last part of the process that depended on external tooling, and the ML-DSA + hardware pair is the attestation. cosign.pub is kept in the repository so the older releases remain verifiable.

Also from 2.0.4, the maintainer signs with a single per-identity key rather than a per-project one. allowed-signers retains every key that has ever signed a release, so earlier releases still verify. If you verified an earlier release, you are accepting a new key. Check why before you do: a signing key that changes without explanation is what a compromise looks like.

2. Reproduce the build yourself

Signatures tell you who signed the image. A reproducible build tells you what is in it: that it was built from the public source and nothing else was added to it. Build the release tag from a fresh clone, with no network in any build step, from the release's published input archive (a generic package hiddenforge-inputs on sambent.dev, fetched and verified with scripts/build_inputs.py), and you get the same two-platform index digest as signatures/hiddenforge.digest.

The full procedure, the flags that make it work and the reasons a fresh clone is required are on Reproducing the Build.

Reproducibility applies from 2.0.4 onward. The 2.x tags no longer rebuild: they pinned exact Alpine package versions, and Alpine has pruned them (v2.0.4 and v2.1.6 fail at apk add); their signatures still verify. 3.0 builds from an input archive that the repository's build-inputs.sha256 locks, kept for the current release and the one before it.

If a check fails

If a signature doesn't verify, or a rebuild doesn't match the documented digest, do not run the image. Stop and ask on the project's channels. A failed check is exactly the signal this is here to give you.

Clone this wiki locally