veridict-verify 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,57 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ verify-demo-bundle:
9
+ runs-on: ${{ matrix.os }}
10
+ strategy:
11
+ matrix:
12
+ os: [ubuntu-latest, windows-latest, macos-latest]
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.12"
18
+ - name: Install package
19
+ run: pip install .
20
+ - name: Verify demo bundle (integrity must hold)
21
+ shell: bash
22
+ run: |
23
+ set +e
24
+ veridict-verify examples/demo.veridict.zip --json
25
+ code=$?
26
+ set -e
27
+ # 0 = VALID, 2 = VALID WITH WARNINGS (pending timestamps in the demo).
28
+ if [ "$code" -ne 0 ] && [ "$code" -ne 2 ]; then
29
+ echo "verifier reported INVALID or crashed (exit $code)"
30
+ exit 1
31
+ fi
32
+ - name: Tampered bundle must fail
33
+ shell: bash
34
+ run: |
35
+ python - <<'EOF'
36
+ import shutil, zipfile
37
+ shutil.copy("examples/demo.veridict.zip", "tampered.veridict.zip")
38
+ # append a byte to the first stored object to break its hash
39
+ import os
40
+ with zipfile.ZipFile("tampered.veridict.zip") as z:
41
+ names = [n for n in z.namelist() if "/objects/" in n or n.startswith("objects")]
42
+ data = {n: z.read(n) for n in z.namelist()}
43
+ target = names[0]
44
+ data[target] = data[target] + b"X"
45
+ with zipfile.ZipFile("tampered.veridict.zip", "w") as z:
46
+ for n, b in data.items():
47
+ z.writestr(n, b)
48
+ EOF
49
+ set +e
50
+ veridict-verify tampered.veridict.zip
51
+ code=$?
52
+ set -e
53
+ if [ "$code" -ne 1 ]; then
54
+ echo "tampered bundle was NOT flagged INVALID (exit $code)"
55
+ exit 1
56
+ fi
57
+ echo "tamper detected correctly"
@@ -0,0 +1,36 @@
1
+ name: Release to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: actions/setup-python@v5
14
+ with:
15
+ python-version: "3.12"
16
+ - name: Build sdist and wheel
17
+ run: |
18
+ pip install build
19
+ python -m build
20
+ - uses: actions/upload-artifact@v4
21
+ with:
22
+ name: dist
23
+ path: dist/
24
+
25
+ publish:
26
+ needs: build
27
+ runs-on: ubuntu-latest
28
+ environment: pypi
29
+ permissions:
30
+ id-token: write # PyPI trusted publishing
31
+ steps:
32
+ - uses: actions/download-artifact@v4
33
+ with:
34
+ name: dist
35
+ path: dist/
36
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,7 @@
1
+ __pycache__/
2
+ *.pyc
3
+ dist/
4
+ build/
5
+ *.egg-info/
6
+ .venv/
7
+ .pytest_cache/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 VERIDICT contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,116 @@
1
+ Metadata-Version: 2.4
2
+ Name: veridict-verify
3
+ Version: 0.2.0
4
+ Summary: Standalone offline verifier for VERIDICT case bundles. Free and open: trust, but re-check.
5
+ Project-URL: Homepage, https://github.com/CXdefense/veridict-verify
6
+ Project-URL: Documentation, https://github.com/CXdefense/veridict-verify/blob/main/docs/bundle-format.md
7
+ Project-URL: Issues, https://github.com/CXdefense/veridict-verify/issues
8
+ Author: VERIDICT contributors
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: ed25519,evidence,hash-chain,osint,provenance,verification
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Legal Industry
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Security
21
+ Classifier: Topic :: Security :: Cryptography
22
+ Requires-Python: >=3.11
23
+ Requires-Dist: cryptography>=43
24
+ Requires-Dist: rfc8785>=0.1.4
25
+ Provides-Extra: timestamps
26
+ Requires-Dist: certifi; extra == 'timestamps'
27
+ Requires-Dist: rfc3161-client>=1.0; extra == 'timestamps'
28
+ Description-Content-Type: text/markdown
29
+
30
+ # veridict-verify
31
+
32
+ Standalone offline verifier for VERIDICT case bundles (`.veridict.zip`).
33
+ Free and open: **trust, but re-check.**
34
+
35
+ This package shares **no runtime code** with the VERIDICT engine. It re-checks
36
+ hashes, signatures, timestamps, citation spans, corroboration ceilings, and
37
+ graph semantics from the published bundle format so a skeptic does not have to
38
+ trust the tool that produced the case. You do not need an account, a server,
39
+ or the engine — only this package and the bundle you were handed.
40
+
41
+ ## Install
42
+
43
+ ```bash
44
+ pip install veridict-verify
45
+ # optional RFC-3161 token parsing:
46
+ pip install 'veridict-verify[timestamps]'
47
+ ```
48
+
49
+ Or from this repository:
50
+
51
+ ```bash
52
+ pip install .
53
+ ```
54
+
55
+ ## Usage
56
+
57
+ ```bash
58
+ veridict-verify path/to/case.veridict.zip
59
+ veridict-verify path/to/case.veridict.zip --json
60
+ veridict-verify path/to/case.veridict.zip --trusted-key <sha256-fingerprint>
61
+ ```
62
+
63
+ Try it right now on the demo bundle in this repository:
64
+
65
+ ```bash
66
+ veridict-verify examples/demo.veridict.zip
67
+ ```
68
+
69
+ ### Exit codes
70
+
71
+ | Code | Meaning |
72
+ |------|---------|
73
+ | 0 | `VALID` — no findings |
74
+ | 2 | `VALID WITH WARNINGS` — integrity holds; review warnings (e.g. pending timestamps, single-source) |
75
+ | 1 | `INVALID` — hash/signature/semantic failure |
76
+
77
+ ### Key pinning
78
+
79
+ Cryptographic verification proves integrity, not identity. Pin a published
80
+ investigator fingerprint:
81
+
82
+ ```bash
83
+ veridict-verify case.veridict.zip --trusted-key abcdef...64hex...
84
+ ```
85
+
86
+ See [docs/key-policy.md](docs/key-policy.md) for custody and publication guidance.
87
+
88
+ ## What it checks
89
+
90
+ - Manifest hash and Ed25519 signature; key id ↔ public key binding
91
+ - Append-only hash chain (seq, prev, body_hash, chain_hash, record signatures)
92
+ - Artifact CAS object re-hash; optional standalone `content_signature`
93
+ - Claim grounding (`supported-by`), exact citation quote/offsets
94
+ - Human `verified-by` signatures; `contradicts` / `supersedes` semantics
95
+ - Independence corroboration ceilings (N vs M)
96
+ - RFC-3161 / OpenTimestamps proof structure where present
97
+ - Key-rotation statements (`veridict-key-rotation/1`)
98
+
99
+ ## Documentation
100
+
101
+ - [Verify a bundle in 5 minutes](docs/verify-in-5-minutes.md)
102
+ - [Bundle format specification](docs/bundle-format.md)
103
+ - [Key policy: custody, publication, rotation](docs/key-policy.md)
104
+
105
+ ## Relationship to the VERIDICT engine
106
+
107
+ The engine that *builds* cases (capture, sealing, AI-assisted analysis,
108
+ reporting) is developed separately. This verifier is intentionally
109
+ independent so that opposing counsel, auditors, and editors can re-check
110
+ conclusions without trusting — or even having — the engine. Conformance
111
+ tests that exercise the verifier against engine-produced bundles run in the
112
+ engine's CI on every commit.
113
+
114
+ ## License
115
+
116
+ MIT
@@ -0,0 +1,87 @@
1
+ # veridict-verify
2
+
3
+ Standalone offline verifier for VERIDICT case bundles (`.veridict.zip`).
4
+ Free and open: **trust, but re-check.**
5
+
6
+ This package shares **no runtime code** with the VERIDICT engine. It re-checks
7
+ hashes, signatures, timestamps, citation spans, corroboration ceilings, and
8
+ graph semantics from the published bundle format so a skeptic does not have to
9
+ trust the tool that produced the case. You do not need an account, a server,
10
+ or the engine — only this package and the bundle you were handed.
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ pip install veridict-verify
16
+ # optional RFC-3161 token parsing:
17
+ pip install 'veridict-verify[timestamps]'
18
+ ```
19
+
20
+ Or from this repository:
21
+
22
+ ```bash
23
+ pip install .
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ ```bash
29
+ veridict-verify path/to/case.veridict.zip
30
+ veridict-verify path/to/case.veridict.zip --json
31
+ veridict-verify path/to/case.veridict.zip --trusted-key <sha256-fingerprint>
32
+ ```
33
+
34
+ Try it right now on the demo bundle in this repository:
35
+
36
+ ```bash
37
+ veridict-verify examples/demo.veridict.zip
38
+ ```
39
+
40
+ ### Exit codes
41
+
42
+ | Code | Meaning |
43
+ |------|---------|
44
+ | 0 | `VALID` — no findings |
45
+ | 2 | `VALID WITH WARNINGS` — integrity holds; review warnings (e.g. pending timestamps, single-source) |
46
+ | 1 | `INVALID` — hash/signature/semantic failure |
47
+
48
+ ### Key pinning
49
+
50
+ Cryptographic verification proves integrity, not identity. Pin a published
51
+ investigator fingerprint:
52
+
53
+ ```bash
54
+ veridict-verify case.veridict.zip --trusted-key abcdef...64hex...
55
+ ```
56
+
57
+ See [docs/key-policy.md](docs/key-policy.md) for custody and publication guidance.
58
+
59
+ ## What it checks
60
+
61
+ - Manifest hash and Ed25519 signature; key id ↔ public key binding
62
+ - Append-only hash chain (seq, prev, body_hash, chain_hash, record signatures)
63
+ - Artifact CAS object re-hash; optional standalone `content_signature`
64
+ - Claim grounding (`supported-by`), exact citation quote/offsets
65
+ - Human `verified-by` signatures; `contradicts` / `supersedes` semantics
66
+ - Independence corroboration ceilings (N vs M)
67
+ - RFC-3161 / OpenTimestamps proof structure where present
68
+ - Key-rotation statements (`veridict-key-rotation/1`)
69
+
70
+ ## Documentation
71
+
72
+ - [Verify a bundle in 5 minutes](docs/verify-in-5-minutes.md)
73
+ - [Bundle format specification](docs/bundle-format.md)
74
+ - [Key policy: custody, publication, rotation](docs/key-policy.md)
75
+
76
+ ## Relationship to the VERIDICT engine
77
+
78
+ The engine that *builds* cases (capture, sealing, AI-assisted analysis,
79
+ reporting) is developed separately. This verifier is intentionally
80
+ independent so that opposing counsel, auditors, and editors can re-check
81
+ conclusions without trusting — or even having — the engine. Conformance
82
+ tests that exercise the verifier against engine-produced bundles run in the
83
+ engine's CI on every commit.
84
+
85
+ ## License
86
+
87
+ MIT
@@ -0,0 +1,209 @@
1
+ # VERIDICT Bundle Format — `veridict-bundle/2`
2
+
3
+ A bundle is a ZIP file (conventional extension `.veridict.zip`) containing a complete,
4
+ self-verifying investigation case. A verifier needs **nothing else**: no account, no
5
+ network (except optional timestamp chain validation), no trust in the producing tool.
6
+
7
+ ## Version compatibility
8
+
9
+ `veridict-bundle/2` is the current export format. It adds atomic `batch` log
10
+ records. Current importers and verifiers accept both v1 and v2:
11
+
12
+ - **v1:** `node`, `edge`, and `seal` records only.
13
+ - **v2:** all v1 records plus `batch`.
14
+
15
+ A v1 manifest containing a batch record is invalid. A v1-only verifier cannot
16
+ read v2 and MUST reject its unknown spec; it must be upgraded rather than
17
+ silently treating v2 as v1.
18
+
19
+ ## Layout
20
+
21
+ ```
22
+ manifest.json top-level commitment: spec, chain head, public keys, signature
23
+ case.json case metadata (id, name, created_at, tool_version)
24
+ graph/log.jsonl hash-chained append-only event log — the source of truth
25
+ objects/sha256/… content-addressed artifact store (path embeds the hash)
26
+ timestamps/ RFC-3161 tokens (<artifact_id>.tsr), OpenTimestamps proofs
27
+ (<artifact_id>.ots), pending.json + ots-status.json queues
28
+ ```
29
+
30
+ ## Trust chain
31
+
32
+ ```
33
+ manifest_signature (Ed25519)
34
+ └─ signs manifest_hash
35
+ └─ manifest_hash = SHA-256 over RFC 8785 canonical JSON of the manifest
36
+ └─ manifest commits to chain_head
37
+ └─ chain_head = chain_hash of the last log record
38
+ └─ every record's chain_hash commits to {seq, prev, kind, body_hash}
39
+ └─ body_hash commits to the node/edge/batch body
40
+ └─ artifact bodies commit to object bytes via sha256
41
+ ```
42
+
43
+ One signature at the top; hashes all the way down. Any byte-level change anywhere
44
+ breaks the chain.
45
+
46
+ ## Canonicalization
47
+
48
+ All hashes are SHA-256 over **RFC 8785 (JCS)** canonical JSON bytes, written as
49
+ `sha256:<64 lowercase hex>`. Implementations MUST use an RFC 8785 library;
50
+ `json.dumps` is not compliant.
51
+
52
+ ## Log records
53
+
54
+ One JSON object per line:
55
+
56
+ | Field | Meaning |
57
+ |-------|---------|
58
+ | `seq` | 0-based, contiguous |
59
+ | `prev` | `chain_hash` of the previous record (`null` for seq 0) |
60
+ | `kind` | v1: `node` \| `edge` \| `seal`; v2 also permits `batch` |
61
+ | `body` | the node/edge body, ordered batch payload, or seal payload |
62
+ | `body_hash` | `hash(body)` |
63
+ | `chain_hash` | `hash({seq, prev, kind, body_hash})` |
64
+ | `signer` | key id (optional) |
65
+ | `sig` | base64 Ed25519 signature over the `chain_hash` string, UTF-8 (optional) |
66
+
67
+ Key id = first 16 hex chars of SHA-256 over the raw 32-byte Ed25519 public key.
68
+
69
+ ### V2 batch records
70
+
71
+ A batch commits an ordered set of graph mutations as one signed, hash-chained
72
+ JSONL event:
73
+
74
+ ```json
75
+ {
76
+ "kind": "batch",
77
+ "body": {
78
+ "entries": [
79
+ {"kind": "node", "body": {"id": "clm_...", "kind": "claim"}},
80
+ {"kind": "edge", "body": {"id": "edg_...", "edge_type": "supported-by"}}
81
+ ]
82
+ }
83
+ }
84
+ ```
85
+
86
+ `entries` MUST be a non-empty array. Every child MUST contain exactly `kind`
87
+ (`node` or `edge`) and `body`. Consumers expand children in array order. The
88
+ record's `body_hash` commits to the complete ordered batch. Where a semantic
89
+ signature refers to an individual node body (for example `verified-by`), the
90
+ verifier hashes that child node body independently.
91
+
92
+ ## Node kinds (PROV alignment)
93
+
94
+ | Kind | PROV concept | Required fields |
95
+ |------|--------------|-----------------|
96
+ | `artifact` | Entity | `sha256`, `size`, `media_type`, `storage_path`, `capture_method`, `captured_at`, `tool_version`, `timestamp_status`, `ots_status`; recommended: `content_signature`, `content_signer` |
97
+ | `claim` | Entity (assertion) | `text`, `label` (`raw`\|`inferred`), `status`, `method`, `source_count`, `single_source`; `confidence` required when inferred |
98
+ | `step` | Activity | `tool`; AI steps carry `model`, `prompt_sha256`, `response_sha256` |
99
+ | `agent` | Agent | `agent_kind` (`human`\|`system`), `name`; humans carry `public_key` |
100
+
101
+ ## Edge types
102
+
103
+ | Type | Direction | Meaning |
104
+ |------|-----------|---------|
105
+ | `supported-by` | claim → artifact/claim | evidence backing |
106
+ | `transformed-by` | node → step | how the node was produced |
107
+ | `verified-by` | claim → agent | human sign-off; `meta` carries `claim_body_hash`, `signature`, `signer`, `signed_at` |
108
+ | `derived-from` | node → node | lineage (e.g. extracted text → original PDF) |
109
+ | `used` | step → artifact | W3C PROV activity-to-entity usage; Source Brief steps use one edge for each declared source and analysis artifact |
110
+
111
+ ## Source Brief steps
112
+
113
+ Hardened Source Brief steps use tool `ollama/source-brief`, role
114
+ `source-brief`, and params field:
115
+
116
+ ```json
117
+ {"source_brief_schema": "veridict-source-brief/1"}
118
+ ```
119
+
120
+ For this schema, the step and its `used` edges are appended in one batch. The
121
+ step's `inputs`, `validated_brief.source_artifact_id`, and
122
+ `validated_brief.analysis_artifact_id` must agree with those edges. Retrieval
123
+ spans contain offsets, scores, and text hashes but not full span text. Every
124
+ persisted factual item is inferred, confidence-scored, and cited; each citation
125
+ must match the analysis artifact and lie inside one hashed retrieval span. The
126
+ `validated_brief_sha256` is the RFC 8785 canonical hash of `validated_brief`.
127
+
128
+ Protocol retrieval limits for `veridict-source-brief/1` are:
129
+
130
+ - `max_context_chars`: integer from **1 through 64,000**, inclusive.
131
+ - `spans`: at most **64** entries.
132
+ - Each span has global character offsets with `0 <= start < end`; total
133
+ `selected_chars` equals the sum of span lengths and cannot exceed
134
+ `max_context_chars`.
135
+ - `score` is a finite, non-negative number and `text_sha256` is 64 lowercase
136
+ hexadecimal characters.
137
+
138
+ Legacy steps that only carry `role: source-brief` have no hardened schema
139
+ contract. Verifiers keep them readable and warn that hardened semantic checks
140
+ are unavailable; they do not infer missing `used` edges or reject the legacy
141
+ step solely for lacking them.
142
+
143
+ ## Verifier obligations
144
+
145
+ A conforming verifier MUST:
146
+
147
+ 1. Reject unknown `spec` values.
148
+ 2. Recompute `manifest_hash` and verify `manifest_signature` against the embedded keys,
149
+ and each key id against its key bytes.
150
+ 3. Replay the full chain: seq contiguity, `prev` links, `body_hash`, `chain_hash`.
151
+ 4. Verify every record signature against manifest keys.
152
+ 5. Re-hash every artifact object and compare with its node's `sha256`.
153
+ 6. Verify `verified-by` signatures against the signed claim's actual `body_hash`.
154
+ 7. Flag as **errors**: any hash/signature mismatch, missing objects, claims with no
155
+ `supported-by` edge, edges to nonexistent nodes.
156
+ 8. Flag as **warnings**: `single_source` claims, pending timestamps, unsigned manifest,
157
+ unknown signers.
158
+
159
+ Verdicts: `VALID` (no findings), `VALID WITH WARNINGS`, `INVALID` (any error).
160
+ Reference exit codes: 0 / 2 / 1.
161
+
162
+ ## Capture methods
163
+
164
+ `capture_method` values: `file-ingest`, `http-fetch`, `browser-render` (Playwright
165
+ Chromium DOM HTML), `browser-screenshot` (full-page PNG derived from a
166
+ `browser-render` artifact), `wacz` (browsertrix-crawler capture), `wacz-import`
167
+ (externally produced WACZ), `text-extraction` (derived text artifact — always
168
+ linked to its source with a `derived-from` edge and to the extraction
169
+ `transformed-by` step).
170
+
171
+ WACZ artifacts (`media_type: application/wacz`) are self-describing web archives
172
+ (Webrecorder format): they replay in ReplayWeb.page and carry per-resource digests
173
+ in their internal `datapackage.json`, on top of VERIDICT's whole-file sealing.
174
+
175
+ ### Standalone content signature (recommended)
176
+
177
+ Optional Artifact fields `content_signature` (base64 Ed25519) and `content_signer`
178
+ (key id) seal the digest independently of the log record. The signed message is the
179
+ UTF-8 string `sha256:<64 lowercase hex>`. A conforming verifier MUST:
180
+
181
+ - when both fields are present: verify the signature against a manifest public key
182
+ (mismatch = error; unknown signer = warning);
183
+ - when both are absent: emit a warning (`artifact has no standalone content signature`)
184
+ so older bundles remain valid.
185
+
186
+ Current engines populate these fields on every sealed Artifact.
187
+
188
+ ## Timestamps
189
+
190
+ Two independent anchors per artifact; both stamp the SHA-256 digest only (content
191
+ never leaves the machine). `pending` states are legal — offline sealing must never
192
+ block an investigation — but are always surfaced by the verifier.
193
+
194
+ **RFC-3161** — `timestamp_status: anchored` requires a token at `timestamp_ref`.
195
+ The engine timestamps the artifact digest as the TSA message; the token's message
196
+ imprint is a hash of that message. Verifiers must accept `SHA-512(digest)`
197
+ (current engine default), `SHA-256(digest)`, or the raw digest as the imprint.
198
+ Anchors may also land *after* sealing (via `timestamp sync`): tokens at the
199
+ conventional path `timestamps/<artifact_id>.tsr` are validated even when the
200
+ node's status says `pending`, since append-only nodes are never rewritten.
201
+
202
+ **OpenTimestamps** — `ots_status: stamped | upgraded` requires a proof at
203
+ `timestamp_ots_ref` (default `timestamps/<artifact_id>.ots`). The proof must carry
204
+ the OTS magic header (`\x00OpenTimestamps\x00\x00Proof\x00\xbf\x89\xe2\xe8\x84\xe8\x92\x94`)
205
+ and commit to the artifact digest. `stamped` means calendar attestation only;
206
+ `upgraded` means a Bitcoin block attestation is present (proofs upgrade
207
+ asynchronously via `veridict timestamp sync`). A conforming verifier MUST check
208
+ existence, magic, and digest commitment; full Bitcoin chain validation via the OTS
209
+ client is recommended but out of the minimal verifier's scope.
@@ -0,0 +1,76 @@
1
+ # Investigator key policy
2
+
3
+ VERIDICT attributions are only as strong as the key that signs them. Cryptographic
4
+ verification proves *integrity* (bytes were not altered after sealing). It does not
5
+ by itself prove *who* held the private key. That identity link is out-of-band.
6
+
7
+ ## Custody
8
+
9
+ - Private keys live at `~/.veridict/id_ed25519.pem` by default.
10
+ - Prefer a passphrase at rest (`veridict keys init --passphrase ...`).
11
+ - Never put a private key or passphrase in a case directory, bundle, prompt, log, or
12
+ screenshot.
13
+ - Bundles carry only public keys (and fingerprints derived from them).
14
+
15
+ ## Fingerprints
16
+
17
+ - **Fingerprint** = SHA-256 (hex, 64 chars) over the raw 32-byte Ed25519 public key.
18
+ - **Key id** = first 16 hex characters of the fingerprint (used in log `signer` fields).
19
+ - Publish the full fingerprint, not only the key id.
20
+
21
+ Show yours:
22
+
23
+ ```bash
24
+ veridict keys show
25
+ ```
26
+
27
+ ## Publishing a fingerprint out-of-band
28
+
29
+ Pick at least one channel a skeptic already trusts for your organization:
30
+
31
+ - Organization website or trust page
32
+ - GPG-signed statement naming the fingerprint and validity window
33
+ - Business card / engagement letter for a named engagement
34
+ - Secure messaging from a known investigator identity
35
+
36
+ The published statement should include: investigator/org name, fingerprint, key id,
37
+ valid-from date, and how to report compromise.
38
+
39
+ ## Verifying with a pinned key
40
+
41
+ ```bash
42
+ veridict-verify case.veridict.zip --trusted-key <full-fingerprint>
43
+ # or a file containing the fingerprint / public key:
44
+ veridict-verify case.veridict.zip --trusted-key ./alice.fingerprint
45
+ ```
46
+
47
+ When `--trusted-key` is set, any manifest signer not in the trusted set is an **error**
48
+ (`INVALID`). Without the flag, the verifier still checks signatures against keys
49
+ embedded in the bundle but cannot assert identity.
50
+
51
+ ## Rotation
52
+
53
+ ```bash
54
+ veridict keys rotate --case ./mycase
55
+ ```
56
+
57
+ This:
58
+
59
+ 1. Generates a new keypair.
60
+ 2. Appends a `human/key-rotation` Step whose statement is signed by the **old** key and
61
+ names the new fingerprint (`veridict-key-rotation/1`).
62
+ 3. Archives the old PEM as `id_ed25519.pem.<old-key-id>.bak` (never deletes it).
63
+ 4. Writes the new PEM to the default path.
64
+
65
+ Publish the new fingerprint out-of-band immediately. Old signatures remain valid under
66
+ the old key; the rotation Step is the bridge a verifier can re-check.
67
+
68
+ ## Compromise procedure
69
+
70
+ 1. Stop using the compromised key.
71
+ 2. Rotate (`veridict keys rotate --case ...`) from a still-trusted machine if possible;
72
+ otherwise generate a fresh key with `keys init --force` and document the break in
73
+ custody in the case as a human Step with a clear reason.
74
+ 3. Publish a revocation notice for the old fingerprint on the same out-of-band channels.
75
+ 4. Re-sign any high-stakes Claims that must carry the new key (`veridict claim sign`).
76
+ 5. Export a new bundle; ask skeptics to pin the new fingerprint.
@@ -0,0 +1,61 @@
1
+ # Verify a VERIDICT bundle in five minutes
2
+
3
+ You do not need an account, the engine, or trust in the producer — only Python 3.11+.
4
+
5
+ ## 1. Install the standalone verifier
6
+
7
+ ```bash
8
+ pip install veridict-verify
9
+ ```
10
+
11
+ Optional (RFC-3161 token parsing):
12
+
13
+ ```bash
14
+ pip install 'veridict-verify[timestamps]'
15
+ ```
16
+
17
+ ## 2. Get the demo bundle
18
+
19
+ Use `examples/demo.veridict.zip` from this repository, or download it from the
20
+ GitHub release assets (optionally with `demo.fingerprint`).
21
+
22
+ ## 3. Verify
23
+
24
+ ```bash
25
+ veridict-verify demo.veridict.zip
26
+ ```
27
+
28
+ Expected: `VALID` or `VALID WITH WARNINGS` (warnings are normal for pending
29
+ timestamps on offline demos). Exit code `0` or `2`.
30
+
31
+ Pin the investigator fingerprint if you received it out-of-band:
32
+
33
+ ```bash
34
+ veridict-verify demo.veridict.zip --trusted-key demo.fingerprint
35
+ # or:
36
+ veridict-verify demo.veridict.zip --trusted-key <64-hex-fingerprint>
37
+ ```
38
+
39
+ ## 4. Tamper once (prove the verifier notices)
40
+
41
+ Unzip, flip one byte in any `objects/sha256/...` file, re-zip, and re-verify:
42
+
43
+ ```bash
44
+ mkdir scratch && cd scratch
45
+ unzip ../demo.veridict.zip
46
+ # flip the first byte of the first object (PowerShell / Python — pick one)
47
+ python -c "from pathlib import Path; p=next(Path('objects').rglob('*'));
48
+ data=bytearray(p.read_bytes()); data[0]^=0xFF; p.write_bytes(data); print(p)"
49
+ cd ..
50
+ python -c "import zipfile, pathlib; z=zipfile.ZipFile('tampered.veridict.zip','w');
51
+ root=pathlib.Path('scratch');
52
+ [z.write(p, p.relative_to(root).as_posix()) for p in root.rglob('*') if p.is_file()]; z.close()"
53
+ veridict-verify tampered.veridict.zip
54
+ ```
55
+
56
+ Expected: `INVALID` with an artifacts error about sha256 mismatch. Exit code `1`.
57
+
58
+ ## What you just proved
59
+
60
+ The bundle's claim chain is independently re-checkable: hashes, signatures,
61
+ citations, and corroboration ceilings do not depend on the producing machine.