# QGPL Toolkit Version 0.1.0 is an experimental local integrity toolkit. It creates real ML-DSA-65 signatures over a canonical manifest containing a file hash. It can detect changed file bytes and verify that the holder of the matching private key signed the manifest. An embedded public key does not establish who owns that key. Obtain its SHA-256 fingerprint through an independently authenticated channel before using a signature to attribute a release to a person or organisation. ## Install the downloaded source Use Python 3.10 or later and a virtual environment. Open a terminal in the directory containing the downloaded archive. ```sh python3 -m venv .venv source .venv/bin/activate python -m pip install ./qgpl-toolkit-0.1.0.zip qgpl --version ``` On Windows create the environment with `py -m venv .venv` and activate it with `.venv\Scripts\Activate.ps1` in PowerShell before the pip command. Installation downloads pinned `pqcrypto==1.0.0` and `rfc8785==0.1.4` dependencies from PyPI. A compatible binary wheel for the cryptography backend is required. Signing and verification perform no network requests. This project has not been published as an installable PyPI release. Use the downloaded source archive. Developers can also run `python -m pip install .` from an extracted source directory on a local filesystem. ## Try a real signature Extract the archive and change into its `qgpl-toolkit-0.1.0` directory before running the example commands. The archive includes a genuinely signed synthetic example. Its public key is embedded in the manifest. The example's private key is not included and its signer has no asserted real-world identity. ```sh qgpl verify examples/results.csv.qgpl.json ``` Keep private keys outside directories you publish or audit. These commands create a project, use the supplied synthetic CSV, sign it and verify it. ```sh qgpl init demo qgpl keygen --out private-keys mkdir demo/release cp examples/results.csv demo/release/results.csv qgpl sign demo/release/results.csv --key private-keys/signing.secret.json qgpl verify demo/release/results.csv.qgpl.json qgpl inspect demo/release/results.csv.qgpl.json qgpl audit demo/release ``` Copy the fingerprint printed by `keygen` or use a fingerprint you have authenticated independently. The following example deliberately uses a placeholder that you must replace. ```sh qgpl verify demo/release/results.csv.qgpl.json --require-trusted --trusted-fingerprint YOUR_AUTHENTICATED_FINGERPRINT ``` Change one number in `demo/release/results.csv` and run verification again. The command returns exit code 1 and reports that the bytes no longer match. If you move a manifest away from its artifact, pass the selected file with `--artifact`. The filename must still match the signed artifact name. ## Commands | Command | What it does | | --- | --- | | `qgpl init directory` | Write the unchanged QGPL 3.0 license and editable project notices | | `qgpl keygen --out directory` | Generate ML-DSA-65 keys without overwriting existing keys | | `qgpl sign file --key secret.json` | Create `file.qgpl.json` with a real post-quantum signature | | `qgpl verify file.qgpl.json` | Verify file bytes and signature, reporting whether a trust pin was supplied | | `qgpl inspect file.qgpl.json` | Read metadata without claiming that verification occurred | | `qgpl audit directory` | Check every file in a flat release directory for a valid sidecar | `verify`, `inspect` and `audit` also support `--json` for machine output. `verify` and `audit` accept `--trusted-fingerprint` and `--require-trusted`. Exit code 0 means the requested checks passed, 1 means a check or file operation failed, and 2 means invalid command usage. `sign` defaults to `LicenseRef-QGPL-3.0`. You may explicitly select `--license LicenseRef-QGPL-3.1-draft` for material released under the proposed new text. `init` always writes the stable 3.0 license. To use the 3.1 draft, review and replace the project license and notices explicitly. A metadata identifier does not change the legal terms attached to the work. ## Supported profile This release uses the named profile `qgpl.single.ml-dsa65.v1` and records the toolkit version as `0.1.0`. It uses SHA-256, ML-DSA-65, RFC 8785 JSON canonicalization, a public key fingerprint and an issuer asserted UTC signing time. The signature value is blanked before canonicalization. Every other manifest field is signed. The profile is a bounded implementation inspired by the historical toolkit specification. It is not a complete implementation of Draft v0.5.1 and does not parse that draft's sample manifests. It produces a single manifest sidecar and does not produce detached signature files. ## Limits that matter - Signature verification confirms control of a key and matching file bytes. It does not prove factual accuracy, authorship, consent, lawful publication, copyright ownership or complete license compliance. - The signing time is self asserted. No trusted timestamp or archival existence proof is included. - Only single-file ML-DSA-65 manifests are supported. Hybrid signatures, root key hierarchies, remote keyservers, revocation, transparency logs and multi-file manifests are not implemented. - Transport security is outside this tool. It does not configure or assess the QGPL transport obligations. - Private keys are unencrypted JSON and are created with mode 0600 on POSIX. Protect the machine, make appropriate backups and never publish them. Windows access controls must be managed separately. - Audit checks a flat directory. Nested directories, symbolic links, orphaned manifests and missing sidecars fail. Keep administrative material and private keys elsewhere or sign each regular release file. - Cryptography dependencies and this application have not received an independent security audit. Assess them before production adoption. ## Validation The automated suite covers real signing and verification, changed artifacts, changed signed metadata, a replaced public key, incorrect trust pins, malformed JSON, unsafe paths, symbolic links, key handling and incomplete release directories. ```sh python -m unittest discover -s tests -v ``` The initial release was exercised on macOS arm64 with Python 3.15. Other platforms have not been independently tested in this release. ## Upstream references - [PQCrypto 1.0.0](https://pypi.org/project/pqcrypto/1.0.0/) - [RFC 8785 implementation](https://pypi.org/project/rfc8785/0.1.4/) - [ML-DSA standard](https://csrc.nist.gov/pubs/fips/204/final) - [Canonicalization standard](https://www.rfc-editor.org/rfc/rfc8785) The package includes the unchanged QGPL 3.0 license in `LICENSE`. Dependency licenses and upstream security properties remain those of their authors.