sumseal 0.1.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.
sumseal-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CyberDredge
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.
sumseal-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,198 @@
1
+ Metadata-Version: 2.4
2
+ Name: sumseal
3
+ Version: 0.1.0
4
+ Summary: Record a SHA-256 manifest of a folder of files and verify it later.
5
+ Author: CyberDredge
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/CyberDredge/sumseal
8
+ Project-URL: Issues, https://github.com/CyberDredge/sumseal/issues
9
+ Keywords: integrity,manifest,sha256,checksum,verification
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: End Users/Desktop
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Security
19
+ Classifier: Topic :: System :: Archiving
20
+ Requires-Python: >=3.11
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Provides-Extra: dev
24
+ Requires-Dist: pytest; extra == "dev"
25
+ Dynamic: license-file
26
+
27
+ # sumseal
28
+
29
+ Record exactly which files you collected and what state they were in, then check later that nothing changed. Zero dependencies, deterministic output, plain-language results.
30
+
31
+ > **What sumseal is and is not.** sumseal records and checks file integrity. It does not prove who created a file or that its content is genuine, and it is not legal advice. Whether a manifest is accepted as evidence is decided by courts and counsel, not by this tool.
32
+
33
+ sumseal writes a small JSON manifest of a folder: every file's path, size, SHA-256, modified time and the time it was hashed, plus where a file came from if you record it. Later, `sumseal verify` tells you, file by file, what is OK, CHANGED, MISSING, NEW or UNREADABLE.
34
+
35
+ - Standard library only. Python 3.11 or newer. Windows, macOS and Linux.
36
+ - No network access, ever. URLs you record are stored, never fetched.
37
+ - Fails closed: anything ambiguous or unreadable is an error or an explicit result, never silently skipped.
38
+
39
+ ## Install
40
+
41
+ ```
42
+ python -m pip install sumseal
43
+ ```
44
+
45
+ Or, from a clone of this repository, `python -m pip install .`
46
+
47
+ This installs the `sumseal` command. `python -m sumseal` works too.
48
+
49
+ On Windows with Smart App Control turned on, the `sumseal` command may be blocked, because the small launcher that pip creates is not signed. Run `python -m sumseal` instead; it does the same thing.
50
+
51
+ ## 60-second example
52
+
53
+ The repository has a tiny folder of fictional files in `examples/demo`.
54
+
55
+ **1. Record the folder.** The manifest is written next to the folder (here `examples/demo.sumseal.json`), never inside it.
56
+
57
+ ```
58
+ $ sumseal create examples/demo --collector "Example Collector" --case DEMO-001
59
+ Recorded 3 files from demo
60
+ Manifest: examples/demo.sumseal.json
61
+ Manifest digest (sha256): 8084a7ad...046e0a
62
+ Anchor this digest somewhere outside the folder.
63
+ ```
64
+
65
+ **2. Anchor the digest.** Copy the manifest digest somewhere the folder's owner cannot quietly change: an email to yourself, a paper notebook, a ticket. The digest covers the whole manifest, so if anyone edits the manifest later, its digest no longer matches what you anchored.
66
+
67
+ **3. Check the folder later.**
68
+
69
+ ```
70
+ $ sumseal verify examples/demo
71
+ Manifest: examples/demo.sumseal.json
72
+ Manifest digest (sha256): 8084a7ad...046e0a
73
+ Compare this digest with the one you anchored when the manifest was made.
74
+
75
+ OK 3 CHANGED 0 MISSING 0 NEW 0 UNREADABLE 0
76
+ Result: everything matches the manifest.
77
+ ```
78
+
79
+ If a file was edited and another added, you would see:
80
+
81
+ ```
82
+ NEW notes/extra.txt
83
+ CHANGED saved-page.txt (size 60 -> 61 bytes)
84
+
85
+ OK 2 CHANGED 1 MISSING 0 NEW 1 UNREADABLE 0
86
+ Result: problems found.
87
+ ```
88
+
89
+ **4. Optionally record a source, then report.**
90
+
91
+ ```
92
+ $ sumseal add-source examples/demo.sumseal.json saved-page.txt https://example.com/post/42 --accessed 2026-01-02T03:04:05Z --note "fictional"
93
+ $ sumseal digest examples/demo.sumseal.json
94
+ $ sumseal report examples/demo.sumseal.json --format md
95
+ ```
96
+
97
+ `add-source` changes the manifest, so it prints a new digest. Anchor the digest only after your last edit.
98
+
99
+ ## Commands
100
+
101
+ ```
102
+ sumseal create <folder> --collector NAME [--case ID] [--exclude GLOB]... [--skip-special] [--out FILE]
103
+ sumseal verify <folder> [--manifest FILE] [--expect-digest HEX]
104
+ sumseal add-source <manifest> <relative-path> <url> --accessed TIME [--note TEXT]
105
+ sumseal digest <manifest>
106
+ sumseal report <manifest> [--format md|csv]
107
+ sumseal --version
108
+ ```
109
+
110
+ - `create` refuses to overwrite an existing manifest, and refuses an `--out` path inside the folder being recorded (nothing is written). `--exclude` globs are matched case-sensitively against each relative path (`*` also matches `/`), a matching folder is left out whole, and the globs are recorded in the manifest so `verify` applies them again.
111
+ - `verify --expect-digest HEX` compares the manifest digest with the one you anchored (64 lowercase hex characters). A different digest prints a `MISMATCH` line and exits 1; a match is confirmed in the output.
112
+ - `add-source` needs the path exactly as it appears in the manifest (use `/` between folders) and a UTC time written like `2026-01-02T03:04:05Z`. It never overwrites a source that is already there.
113
+ - `report` writes UTF-8 to standard output. In CSV, cells that start with `=`, `+`, `-` or `@` get a leading `'` so spreadsheets do not run them as formulas.
114
+
115
+ ### Verify results
116
+
117
+ | Result | Meaning |
118
+ |---|---|
119
+ | OK | Present, same size, same hash |
120
+ | CHANGED | Present, size or hash differs (or a file became a link, or the reverse) |
121
+ | MISSING | In the manifest, not in the folder |
122
+ | NEW | In the folder, not in the manifest |
123
+ | UNREADABLE | Cannot be read. Counts as a problem |
124
+
125
+ A changed modified time alone is printed as a note, not a failure, because copying files changes it.
126
+
127
+ ### Exit codes
128
+
129
+ | Code | Meaning |
130
+ |---|---|
131
+ | 0 | Everything OK |
132
+ | 1 | Problems found, or output cut short because the command reading it exited early (for example when `sumseal report` is piped to `head`). Nothing is printed in that case |
133
+ | 2 | Usage or input error (including an invalid manifest) |
134
+ | 3 | Internal error: a bug in sumseal. The message starts with `sumseal: internal error:`; please report it |
135
+
136
+ On Windows, piping `verify` or `create` to a command that exits early can show an internal-error message and exit 3.
137
+
138
+ ## Fail-closed rules
139
+
140
+ - Symlinks, junctions and other special files stop `create` with a list, unless you pass `--skip-special`. Skipped items are then recorded in the manifest. Links are never followed.
141
+ - An unreadable file, an empty folder, or names that collide after ignoring case or Unicode normalization (for example the same accented name stored in two different Unicode forms) stop `create`. No manifest is written.
142
+ - Hidden files are included. Nothing is ignored unless you exclude it, and exclusions are recorded.
143
+ - `verify` validates the manifest strictly before comparing anything, and only opens files it finds by walking the folder, so a tampered manifest cannot make it read anything outside the folder.
144
+ - File names with control or invisible characters are printed escaped, so they cannot disguise themselves in the output.
145
+
146
+ ## Manifest format
147
+
148
+ JSON, `schema_version` 1, pretty-printed with 2-space indentation. A fictional example:
149
+
150
+ ```json
151
+ {
152
+ "schema_version": 1,
153
+ "tool_version": "0.1.0",
154
+ "created_utc": "2026-01-02T03:04:05Z",
155
+ "collector": "Example Collector",
156
+ "case_id": "DEMO-001",
157
+ "root_name": "demo",
158
+ "hash_algorithm": "sha256",
159
+ "excludes": [],
160
+ "skipped": [],
161
+ "files": [
162
+ {
163
+ "path": "saved-page.txt",
164
+ "size": 60,
165
+ "sha256": "8aae1eee4992ad3b220ce4c4dc8efe5728acbc85ac68bce4f3cd396e36bda368",
166
+ "mtime_utc": "2026-01-01T00:00:00Z",
167
+ "hashed_utc": "2026-01-02T03:04:05Z",
168
+ "source": {
169
+ "url": "https://example.com/post/42",
170
+ "accessed_utc": "2026-01-02T03:04:05Z",
171
+ "note": "fictional"
172
+ }
173
+ }
174
+ ]
175
+ }
176
+ ```
177
+
178
+ - `root_name` is the folder name only. Absolute paths never appear.
179
+ - `case_id` and `source` are optional. `note` inside `source` is optional.
180
+ - `files` are sorted by `path` in UTF-8 byte order. Paths are relative, use `/`, and are NFC-normalized.
181
+ - `skipped` entries are `{"path", "kind"}`, where `kind` is `symlink`, `reparse_point` or `other`.
182
+ - All times are UTC, whole seconds, ending in `Z`.
183
+ - **Manifest digest** = SHA-256 of `json.dumps(manifest, sort_keys=True, separators=(",", ":"), ensure_ascii=False, allow_nan=False)` encoded as UTF-8. Reformatting the file never changes the digest.
184
+
185
+ ## Development
186
+
187
+ ```
188
+ python -m venv .venv
189
+ .venv\Scripts\Activate.ps1 # Windows PowerShell; on macOS or Linux: source .venv/bin/activate
190
+ python -m pip install -e ".[dev]"
191
+ pytest
192
+ ```
193
+
194
+ The only development dependency is `pytest`. Tests never use the network.
195
+
196
+ ## License
197
+
198
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,172 @@
1
+ # sumseal
2
+
3
+ Record exactly which files you collected and what state they were in, then check later that nothing changed. Zero dependencies, deterministic output, plain-language results.
4
+
5
+ > **What sumseal is and is not.** sumseal records and checks file integrity. It does not prove who created a file or that its content is genuine, and it is not legal advice. Whether a manifest is accepted as evidence is decided by courts and counsel, not by this tool.
6
+
7
+ sumseal writes a small JSON manifest of a folder: every file's path, size, SHA-256, modified time and the time it was hashed, plus where a file came from if you record it. Later, `sumseal verify` tells you, file by file, what is OK, CHANGED, MISSING, NEW or UNREADABLE.
8
+
9
+ - Standard library only. Python 3.11 or newer. Windows, macOS and Linux.
10
+ - No network access, ever. URLs you record are stored, never fetched.
11
+ - Fails closed: anything ambiguous or unreadable is an error or an explicit result, never silently skipped.
12
+
13
+ ## Install
14
+
15
+ ```
16
+ python -m pip install sumseal
17
+ ```
18
+
19
+ Or, from a clone of this repository, `python -m pip install .`
20
+
21
+ This installs the `sumseal` command. `python -m sumseal` works too.
22
+
23
+ On Windows with Smart App Control turned on, the `sumseal` command may be blocked, because the small launcher that pip creates is not signed. Run `python -m sumseal` instead; it does the same thing.
24
+
25
+ ## 60-second example
26
+
27
+ The repository has a tiny folder of fictional files in `examples/demo`.
28
+
29
+ **1. Record the folder.** The manifest is written next to the folder (here `examples/demo.sumseal.json`), never inside it.
30
+
31
+ ```
32
+ $ sumseal create examples/demo --collector "Example Collector" --case DEMO-001
33
+ Recorded 3 files from demo
34
+ Manifest: examples/demo.sumseal.json
35
+ Manifest digest (sha256): 8084a7ad...046e0a
36
+ Anchor this digest somewhere outside the folder.
37
+ ```
38
+
39
+ **2. Anchor the digest.** Copy the manifest digest somewhere the folder's owner cannot quietly change: an email to yourself, a paper notebook, a ticket. The digest covers the whole manifest, so if anyone edits the manifest later, its digest no longer matches what you anchored.
40
+
41
+ **3. Check the folder later.**
42
+
43
+ ```
44
+ $ sumseal verify examples/demo
45
+ Manifest: examples/demo.sumseal.json
46
+ Manifest digest (sha256): 8084a7ad...046e0a
47
+ Compare this digest with the one you anchored when the manifest was made.
48
+
49
+ OK 3 CHANGED 0 MISSING 0 NEW 0 UNREADABLE 0
50
+ Result: everything matches the manifest.
51
+ ```
52
+
53
+ If a file was edited and another added, you would see:
54
+
55
+ ```
56
+ NEW notes/extra.txt
57
+ CHANGED saved-page.txt (size 60 -> 61 bytes)
58
+
59
+ OK 2 CHANGED 1 MISSING 0 NEW 1 UNREADABLE 0
60
+ Result: problems found.
61
+ ```
62
+
63
+ **4. Optionally record a source, then report.**
64
+
65
+ ```
66
+ $ sumseal add-source examples/demo.sumseal.json saved-page.txt https://example.com/post/42 --accessed 2026-01-02T03:04:05Z --note "fictional"
67
+ $ sumseal digest examples/demo.sumseal.json
68
+ $ sumseal report examples/demo.sumseal.json --format md
69
+ ```
70
+
71
+ `add-source` changes the manifest, so it prints a new digest. Anchor the digest only after your last edit.
72
+
73
+ ## Commands
74
+
75
+ ```
76
+ sumseal create <folder> --collector NAME [--case ID] [--exclude GLOB]... [--skip-special] [--out FILE]
77
+ sumseal verify <folder> [--manifest FILE] [--expect-digest HEX]
78
+ sumseal add-source <manifest> <relative-path> <url> --accessed TIME [--note TEXT]
79
+ sumseal digest <manifest>
80
+ sumseal report <manifest> [--format md|csv]
81
+ sumseal --version
82
+ ```
83
+
84
+ - `create` refuses to overwrite an existing manifest, and refuses an `--out` path inside the folder being recorded (nothing is written). `--exclude` globs are matched case-sensitively against each relative path (`*` also matches `/`), a matching folder is left out whole, and the globs are recorded in the manifest so `verify` applies them again.
85
+ - `verify --expect-digest HEX` compares the manifest digest with the one you anchored (64 lowercase hex characters). A different digest prints a `MISMATCH` line and exits 1; a match is confirmed in the output.
86
+ - `add-source` needs the path exactly as it appears in the manifest (use `/` between folders) and a UTC time written like `2026-01-02T03:04:05Z`. It never overwrites a source that is already there.
87
+ - `report` writes UTF-8 to standard output. In CSV, cells that start with `=`, `+`, `-` or `@` get a leading `'` so spreadsheets do not run them as formulas.
88
+
89
+ ### Verify results
90
+
91
+ | Result | Meaning |
92
+ |---|---|
93
+ | OK | Present, same size, same hash |
94
+ | CHANGED | Present, size or hash differs (or a file became a link, or the reverse) |
95
+ | MISSING | In the manifest, not in the folder |
96
+ | NEW | In the folder, not in the manifest |
97
+ | UNREADABLE | Cannot be read. Counts as a problem |
98
+
99
+ A changed modified time alone is printed as a note, not a failure, because copying files changes it.
100
+
101
+ ### Exit codes
102
+
103
+ | Code | Meaning |
104
+ |---|---|
105
+ | 0 | Everything OK |
106
+ | 1 | Problems found, or output cut short because the command reading it exited early (for example when `sumseal report` is piped to `head`). Nothing is printed in that case |
107
+ | 2 | Usage or input error (including an invalid manifest) |
108
+ | 3 | Internal error: a bug in sumseal. The message starts with `sumseal: internal error:`; please report it |
109
+
110
+ On Windows, piping `verify` or `create` to a command that exits early can show an internal-error message and exit 3.
111
+
112
+ ## Fail-closed rules
113
+
114
+ - Symlinks, junctions and other special files stop `create` with a list, unless you pass `--skip-special`. Skipped items are then recorded in the manifest. Links are never followed.
115
+ - An unreadable file, an empty folder, or names that collide after ignoring case or Unicode normalization (for example the same accented name stored in two different Unicode forms) stop `create`. No manifest is written.
116
+ - Hidden files are included. Nothing is ignored unless you exclude it, and exclusions are recorded.
117
+ - `verify` validates the manifest strictly before comparing anything, and only opens files it finds by walking the folder, so a tampered manifest cannot make it read anything outside the folder.
118
+ - File names with control or invisible characters are printed escaped, so they cannot disguise themselves in the output.
119
+
120
+ ## Manifest format
121
+
122
+ JSON, `schema_version` 1, pretty-printed with 2-space indentation. A fictional example:
123
+
124
+ ```json
125
+ {
126
+ "schema_version": 1,
127
+ "tool_version": "0.1.0",
128
+ "created_utc": "2026-01-02T03:04:05Z",
129
+ "collector": "Example Collector",
130
+ "case_id": "DEMO-001",
131
+ "root_name": "demo",
132
+ "hash_algorithm": "sha256",
133
+ "excludes": [],
134
+ "skipped": [],
135
+ "files": [
136
+ {
137
+ "path": "saved-page.txt",
138
+ "size": 60,
139
+ "sha256": "8aae1eee4992ad3b220ce4c4dc8efe5728acbc85ac68bce4f3cd396e36bda368",
140
+ "mtime_utc": "2026-01-01T00:00:00Z",
141
+ "hashed_utc": "2026-01-02T03:04:05Z",
142
+ "source": {
143
+ "url": "https://example.com/post/42",
144
+ "accessed_utc": "2026-01-02T03:04:05Z",
145
+ "note": "fictional"
146
+ }
147
+ }
148
+ ]
149
+ }
150
+ ```
151
+
152
+ - `root_name` is the folder name only. Absolute paths never appear.
153
+ - `case_id` and `source` are optional. `note` inside `source` is optional.
154
+ - `files` are sorted by `path` in UTF-8 byte order. Paths are relative, use `/`, and are NFC-normalized.
155
+ - `skipped` entries are `{"path", "kind"}`, where `kind` is `symlink`, `reparse_point` or `other`.
156
+ - All times are UTC, whole seconds, ending in `Z`.
157
+ - **Manifest digest** = SHA-256 of `json.dumps(manifest, sort_keys=True, separators=(",", ":"), ensure_ascii=False, allow_nan=False)` encoded as UTF-8. Reformatting the file never changes the digest.
158
+
159
+ ## Development
160
+
161
+ ```
162
+ python -m venv .venv
163
+ .venv\Scripts\Activate.ps1 # Windows PowerShell; on macOS or Linux: source .venv/bin/activate
164
+ python -m pip install -e ".[dev]"
165
+ pytest
166
+ ```
167
+
168
+ The only development dependency is `pytest`. Tests never use the network.
169
+
170
+ ## License
171
+
172
+ MIT. See [LICENSE](LICENSE).
@@ -0,0 +1,42 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "sumseal"
7
+ version = "0.1.0"
8
+ description = "Record a SHA-256 manifest of a folder of files and verify it later."
9
+ readme = "README.md"
10
+ authors = [{ name = "CyberDredge" }]
11
+ keywords = ["integrity", "manifest", "sha256", "checksum", "verification"]
12
+ classifiers = [
13
+ "Development Status :: 3 - Alpha",
14
+ "Environment :: Console",
15
+ "Intended Audience :: End Users/Desktop",
16
+ "Operating System :: OS Independent",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Topic :: Security",
22
+ "Topic :: System :: Archiving",
23
+ ]
24
+ license = "MIT"
25
+ requires-python = ">=3.11"
26
+ dependencies = []
27
+
28
+ [project.urls]
29
+ Homepage = "https://github.com/CyberDredge/sumseal"
30
+ Issues = "https://github.com/CyberDredge/sumseal/issues"
31
+
32
+ [project.scripts]
33
+ sumseal = "sumseal.cli:main"
34
+
35
+ [project.optional-dependencies]
36
+ dev = ["pytest"]
37
+
38
+ [tool.setuptools.packages.find]
39
+ where = ["src"]
40
+
41
+ [tool.pytest.ini_options]
42
+ testpaths = ["tests"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,7 @@
1
+ """sumseal: record a SHA-256 manifest of a folder of files and verify it later.
2
+
3
+ sumseal records file integrity only. It does not prove who created a file or
4
+ that its content is genuine.
5
+ """
6
+
7
+ __version__ = "0.1.0"
@@ -0,0 +1,5 @@
1
+ """Allow ``python -m sumseal``."""
2
+
3
+ from .cli import main
4
+
5
+ raise SystemExit(main())