Skip to content

Verifying the Image

Sam Bent edited this page Oct 30, 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:2.1.4   # the maintainer's own registry
docker pull doingfedtime/hiddenforge:2.1.4      # Docker Hub

Both serve the identical digest, and the signatures below verify 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:2.1.4 | sha256sum
# or
docker buildx imagetools inspect sambent.dev/sam/hiddenforge:2.1.4 | head -3

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

1. Check the signatures

The release is signed two separate ways, with no dependency on any 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 both 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:<version> --json

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. 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.

2.1.0 to 2.1.4 are signed with ML-DSA-65 only. There is no hiddenforge.digest.sig for them, so verify with --allow-pq-only and use the ML-DSA check below. A hardware signature may be added later over the same digest.

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 was 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. (2.1.0, 2.1.1 and 2.1.2 do not carry one; see the note above.)

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

Both sign the same image digest. Together they 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 was slipped in along the way. Build the release tag from a fresh clone 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. An old tag can stop rebuilding once Alpine prunes the exact package versions it pins (v2.0.4 no longer builds for that reason); its signatures still verify.

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