keyanchor 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.
- keyanchor-0.1.0/LICENSE +202 -0
- keyanchor-0.1.0/NOTICE +5 -0
- keyanchor-0.1.0/PKG-INFO +323 -0
- keyanchor-0.1.0/README.md +298 -0
- keyanchor-0.1.0/keyanchor/__init__.py +3 -0
- keyanchor-0.1.0/keyanchor/__main__.py +5 -0
- keyanchor-0.1.0/keyanchor/canon.py +62 -0
- keyanchor-0.1.0/keyanchor/cli.py +608 -0
- keyanchor-0.1.0/keyanchor/completions.py +117 -0
- keyanchor-0.1.0/keyanchor/github.py +65 -0
- keyanchor-0.1.0/keyanchor/gitmanifest.py +81 -0
- keyanchor-0.1.0/keyanchor/keys.py +111 -0
- keyanchor-0.1.0/keyanchor/ots.py +394 -0
- keyanchor-0.1.0/keyanchor/prompt.py +155 -0
- keyanchor-0.1.0/keyanchor/render.py +386 -0
- keyanchor-0.1.0/keyanchor/setup.py +317 -0
- keyanchor-0.1.0/keyanchor/ssh.py +120 -0
- keyanchor-0.1.0/keyanchor/store.py +224 -0
- keyanchor-0.1.0/keyanchor/verify.py +378 -0
- keyanchor-0.1.0/keyanchor.egg-info/PKG-INFO +323 -0
- keyanchor-0.1.0/keyanchor.egg-info/SOURCES.txt +29 -0
- keyanchor-0.1.0/keyanchor.egg-info/dependency_links.txt +1 -0
- keyanchor-0.1.0/keyanchor.egg-info/entry_points.txt +3 -0
- keyanchor-0.1.0/keyanchor.egg-info/top_level.txt +1 -0
- keyanchor-0.1.0/pyproject.toml +41 -0
- keyanchor-0.1.0/setup.cfg +4 -0
- keyanchor-0.1.0/tests/test_canon_ots.py +146 -0
- keyanchor-0.1.0/tests/test_completions.py +57 -0
- keyanchor-0.1.0/tests/test_flow.py +566 -0
- keyanchor-0.1.0/tests/test_gitmanifest.py +52 -0
- keyanchor-0.1.0/tests/test_render.py +100 -0
keyanchor-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
keyanchor-0.1.0/NOTICE
ADDED
keyanchor-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: keyanchor
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Bind your SSH identity key to a post-quantum key and anchor the binding in Bitcoin, before quantum computers can forge it.
|
|
5
|
+
Author: JustaRsearchGuy
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/JustaRsearchGuy/keyanchor
|
|
8
|
+
Project-URL: Specification, https://github.com/JustaRsearchGuy/keyanchor/blob/main/docs/SPEC.md
|
|
9
|
+
Project-URL: Issues, https://github.com/JustaRsearchGuy/keyanchor/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/JustaRsearchGuy/keyanchor/blob/main/CHANGELOG.md
|
|
11
|
+
Keywords: post-quantum,ssh,ml-dsa,opentimestamps,bitcoin,code-signing,supply-chain
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: MacOS
|
|
16
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Topic :: Security :: Cryptography
|
|
19
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
License-File: NOTICE
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
<h1 align="center">
|
|
27
|
+
<img src="docs/logo.svg" alt="" width="112"><br>
|
|
28
|
+
keyanchor
|
|
29
|
+
</h1>
|
|
30
|
+
|
|
31
|
+
<p align="center">
|
|
32
|
+
<b>Link your current SSH key to a post-quantum successor, so people can verify which key you chose if your old key is ever compromised.</b><br>
|
|
33
|
+
Quantum computers will be able to forge today's SSH keys; a Bitcoin timestamp proves your choice came first.
|
|
34
|
+
</p>
|
|
35
|
+
|
|
36
|
+
<p align="center">
|
|
37
|
+
<a href="#install">Install</a> ·
|
|
38
|
+
<a href="#start">Start</a> ·
|
|
39
|
+
<a href="#show-it-on-github">GitHub Action</a> ·
|
|
40
|
+
<a href="#how-it-works">How it works</a> ·
|
|
41
|
+
<a href="docs/SPEC.md">Spec</a> ·
|
|
42
|
+
<a href="SECURITY.md">Security</a>
|
|
43
|
+
</p>
|
|
44
|
+
|
|
45
|
+
<p align="center">
|
|
46
|
+
<a href="https://github.com/JustaRsearchGuy/keyanchor/actions/workflows/ci.yml"><img src="https://github.com/JustaRsearchGuy/keyanchor/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
47
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue.svg" alt="License: Apache-2.0"></a>
|
|
48
|
+
<img src="https://img.shields.io/badge/python-3.9%2B-blue.svg" alt="Python 3.9+">
|
|
49
|
+
<img src="https://img.shields.io/badge/python%20deps-0-brightgreen.svg" alt="No Python package dependencies">
|
|
50
|
+
<a href="#install"><img src="https://img.shields.io/badge/brew-JustaRsearchGuy%2Ftap%2Fka-orange.svg" alt="Homebrew: brew install JustaRsearchGuy/tap/ka"></a>
|
|
51
|
+
</p>
|
|
52
|
+
|
|
53
|
+
keyanchor makes your current SSH key (Ed25519, the one GitHub knows) sign a statement naming a hybrid
|
|
54
|
+
post-quantum key (ML-DSA-44 + Ed25519), and timestamps that statement in Bitcoin through
|
|
55
|
+
[OpenTimestamps](https://opentimestamps.org). When a quantum computer eventually derives your Ed25519
|
|
56
|
+
private key, the forger can sign anything — except a statement that is *older* than yours. Verifiers trust
|
|
57
|
+
the earliest anchored binding, and from then on only your post-quantum key.
|
|
58
|
+
|
|
59
|
+
<p align="center">
|
|
60
|
+
<img src="docs/how-it-works.svg" alt="You anchor 'K hands over to P' in Bitcoin block 978,942. Years later a forger who derived K anchors 'K hands over to F' in a much later block. A verifier asks which binding of K is earliest: yours, so it trusts P and ignores F." width="900">
|
|
61
|
+
</p>
|
|
62
|
+
|
|
63
|
+
- **No Python package dependencies.** Standard library only (Python 3.9+; macOS's built-in `python3` is
|
|
64
|
+
enough). It needs `git` and OpenSSH ≥ 10.6, see [Install](#install).
|
|
65
|
+
- **No home-made crypto.** Every signature is OpenSSH SSHSIG made and checked by your system `ssh-keygen`.
|
|
66
|
+
- **No SHA-1 trust.** Git trees are re-hashed file by file with SHA-256; git's SHA-1 ids are never what is signed.
|
|
67
|
+
- **No accounts, no server, no fees.** Public OpenTimestamps calendars pay the Bitcoin fee for everyone.
|
|
68
|
+
|
|
69
|
+
> [!IMPORTANT]
|
|
70
|
+
> **Alpha (0.1).** The format may still change before 1.0; any change bumps `schema`. The
|
|
71
|
+
> `mldsa44-ed25519` composite signature is an [IETF draft](https://datatracker.ietf.org/doc/draft-miller-sshm-mldsa44-ed25519-composite-sigs/)
|
|
72
|
+
> that OpenSSH enables by default since 10.6. Keys from its earlier experimental support (10.4–10.5) are
|
|
73
|
+
> rejected: OpenSSH 10.6+ cannot verify them.
|
|
74
|
+
|
|
75
|
+
> [!NOTE]
|
|
76
|
+
> **Nothing about you leaves your machine** except a blinded 32-byte hash sent to the timestamp
|
|
77
|
+
> calendars, reads of public Bitcoin block headers during `verify`, and (only with `--github`) a
|
|
78
|
+
> lookup of your public GitHub keys. No telemetry, no account, no keyanchor server.
|
|
79
|
+
|
|
80
|
+
## Install
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
brew install JustaRsearchGuy/tap/keyanchor # or the short name: JustaRsearchGuy/tap/ka
|
|
84
|
+
brew install openssh && brew unlink openssh # OpenSSH 10.6, next to the system one
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
keyanchor needs **OpenSSH ≥ 10.6**, the first release with final post-quantum keys. macOS still ships
|
|
88
|
+
10.5; the second line installs 10.6 without replacing your system `ssh` (and its Keychain options), and
|
|
89
|
+
keyanchor finds it by itself. On Linux, use your distribution's OpenSSH once it reaches 10.6.
|
|
90
|
+
|
|
91
|
+
Without Homebrew: `pipx install keyanchor` (PyPI, with signed provenance), or run
|
|
92
|
+
`bin/keyanchor` from a checkout. Python ≥ 3.9 and `git`, nothing else.
|
|
93
|
+
|
|
94
|
+
**Tab completion** comes with Homebrew. Otherwise, for commands and flags:
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
keyanchor completions fish | tee ~/.config/fish/completions/{keyanchor,ka}.fish >/dev/null # fish
|
|
98
|
+
echo 'eval "$(keyanchor completions zsh)"' >> ~/.zshrc # zsh (after compinit)
|
|
99
|
+
echo 'eval "$(keyanchor completions bash)"' >> ~/.bashrc # bash
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Uninstall:** `brew uninstall keyanchor` (or `pipx uninstall keyanchor`). keyanchor never deletes your
|
|
103
|
+
keys: your post-quantum key in `~/.ssh`, its backup in your password manager and the `.keyanchor/`
|
|
104
|
+
proofs in your repositories stay. Delete them yourself only if you are sure; a published binding cannot
|
|
105
|
+
be recalled from Bitcoin, so revoke the key first (`keyanchor` → Revoke) if you stop using it.
|
|
106
|
+
|
|
107
|
+
## Start
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
keyanchor # or the short name: ka
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The first time, it walks you through everything: your GitHub username, a new post-quantum key, the
|
|
114
|
+
backup, the Bitcoin timestamp. Afterwards the same command opens a menu: check your status, sign a
|
|
115
|
+
release, make a release bundle, back up, replace or revoke your key. Arrow keys or numbers; `q` quits.
|
|
116
|
+
|
|
117
|
+
## Use without the menu
|
|
118
|
+
|
|
119
|
+
Every step is also a plain command, for scripts and CI. In the repository you publish:
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
# 1. Once: bind your current key to a new post-quantum key (prompts for the new key's passphrase).
|
|
123
|
+
# keyanchor finds the key GitHub knows as you: in your ssh-agent, 1Password or ~/.ssh.
|
|
124
|
+
keyanchor init --github <you> --gen-pq ~/.ssh/id_mldsa44_ed25519
|
|
125
|
+
git add .keyanchor && git commit -S -m "keyanchor: bind post-quantum key"
|
|
126
|
+
|
|
127
|
+
# 2. A few hours later: fetch the Bitcoin proof. Rerun until nothing is pending.
|
|
128
|
+
keyanchor upgrade && git commit -am "keyanchor: bitcoin proofs"
|
|
129
|
+
|
|
130
|
+
# 3. Every release: vouch for the exact content with your post-quantum key.
|
|
131
|
+
keyanchor countersign --pq ~/.ssh/id_mldsa44_ed25519 --ref v1.0 --file dist/app.tar.gz
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Anyone, any time later:
|
|
135
|
+
|
|
136
|
+
```sh
|
|
137
|
+
keyanchor verify # the whole chain
|
|
138
|
+
keyanchor verify --ref v1.0 --file app.tar.gz # is this exact content vouched for?
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
<p align="center">
|
|
142
|
+
<img src="docs/demo.svg" alt="Terminal: keyanchor init and countersign sign and timestamp; verify shows the genuine app.tar.gz waiting for Bitcoin and the tampered evil.tar.gz refuted" width="760">
|
|
143
|
+
</p>
|
|
144
|
+
|
|
145
|
+
<sub>A real run, minutes after stamping: the genuine file waits for Bitcoin (◷), the tampered copy is refuted (✘).
|
|
146
|
+
A few hours later `keyanchor upgrade` turns ◷ into ✔. Regenerate with `bash scripts/demo.sh`.</sub>
|
|
147
|
+
|
|
148
|
+
Keys appear as the same `SHA256:` fingerprints that `ssh-keygen -l` and GitHub's key settings show, so
|
|
149
|
+
you can compare them by eye. Colours appear in a terminal; `NO_COLOR` turns them off. `--format json`
|
|
150
|
+
gives scripts the same rows; `--details` adds the per-statement technical report.
|
|
151
|
+
|
|
152
|
+
| Exit | Meaning |
|
|
153
|
+
|---|---|
|
|
154
|
+
| `0` | verified |
|
|
155
|
+
| `1` | refuted — a signature, proof or rule failed, or nothing covers the content you asked about |
|
|
156
|
+
| `2` | unverifiable — offline, explorer unreachable, or an undecidable tie |
|
|
157
|
+
| `3` | pending — waiting for Bitcoin; run `keyanchor upgrade` |
|
|
158
|
+
|
|
159
|
+
Rotating or retiring keys: `keyanchor rotate --old-pq A --new-pq B` hands authority to a new post-quantum
|
|
160
|
+
key (both sign). `keyanchor revoke --pq A` ends A's authority from the revocation's anchor block.
|
|
161
|
+
`keyanchor stamp` retries statements that never reached a calendar. `--dir` points at a store elsewhere.
|
|
162
|
+
|
|
163
|
+
**Back up your post-quantum key.** Rotation and revocation need it to sign; a lost key cannot hand over
|
|
164
|
+
authority, and after Q-Day your classical key no longer can either.
|
|
165
|
+
|
|
166
|
+
**Always run `upgrade`.** A fresh proof is only a calendar's promise. Until `upgrade` stores the Bitcoin
|
|
167
|
+
path, the proof dies if the calendars do.
|
|
168
|
+
|
|
169
|
+
## Use with your password manager
|
|
170
|
+
|
|
171
|
+
keyanchor signs through whichever SSH agent holds your key. It checks password-manager agents first,
|
|
172
|
+
because they ask you to approve every signature, then the `IdentityAgent` your `~/.ssh/config` sets for
|
|
173
|
+
`github.com`, then `SSH_AUTH_SOCK`, then key files in `~/.ssh`. How you approve is up to your manager:
|
|
174
|
+
Touch ID, Apple Watch, or typing your master password all work the same.
|
|
175
|
+
|
|
176
|
+
| Where your GitHub key lives | Recognised automatically |
|
|
177
|
+
|---|---|
|
|
178
|
+
| 1Password (Settings → Developer → *Use the SSH agent*) | ✅ |
|
|
179
|
+
| Bitwarden, Strongbox, Proton Pass (turn on their SSH agent) | ✅ |
|
|
180
|
+
| Secretive (Secure Enclave keys) | ✅ |
|
|
181
|
+
| KeePassXC and any other agent | ✅ via `SSH_AUTH_SOCK` or `IdentityAgent` |
|
|
182
|
+
| YubiKey or other FIDO2 key (`ssh-keygen -t ed25519-sk`, add it on GitHub) | ✅ keyanchor asks you to touch it |
|
|
183
|
+
|
|
184
|
+
1. Import your existing GitHub key into the manager (1Password: *New Item → SSH Key → Add Private Key →
|
|
185
|
+
Import a Key File*; in file dialogs Cmd+Shift+. shows `~/.ssh`), or create a new key there and add it
|
|
186
|
+
on GitHub as both an *Authentication* and a *Signing* key.
|
|
187
|
+
2. Run `keyanchor init --github <you> …`. It reports `found your GitHub key … in <manager>` and the
|
|
188
|
+
manager asks you to approve. If the key only signs without asking, keyanchor says so.
|
|
189
|
+
|
|
190
|
+
Back up the post-quantum key with `keyanchor backup`: it saves the file to 1Password when its CLI (`op`) is
|
|
191
|
+
installed, and otherwise walks you through saving it by hand in any password manager. Store the
|
|
192
|
+
passphrase in the same item.
|
|
193
|
+
|
|
194
|
+
> [!NOTE]
|
|
195
|
+
> 1Password's SSH agent cannot hold post-quantum keys yet ([feature request](https://www.1password.community/developers-69/feature-request-post-quantum-ssh-key-support-ml-dsa-26388)),
|
|
196
|
+
> and as far as we know no other agent or YubiKey can either. Keep `~/.ssh/id_mldsa44_ed25519` as a
|
|
197
|
+
> passphrase-protected file and back it up as above.
|
|
198
|
+
|
|
199
|
+
Want an approval prompt for the post-quantum key too? Load it into an OpenSSH ≥ 10.6 `ssh-agent` with
|
|
200
|
+
`ssh-add -c` and pass the public half (`--pq ~/.ssh/id_mldsa44_ed25519.pub`). The agent then asks its
|
|
201
|
+
`SSH_ASKPASS` helper before every signature; a declined prompt makes keyanchor stop with nothing written.
|
|
202
|
+
Third-party helpers can turn that prompt into Touch ID; review one before trusting it with your key.
|
|
203
|
+
|
|
204
|
+
## Ship the proof with your releases
|
|
205
|
+
|
|
206
|
+
People who download only `app.tar.gz` from a release page have no `.keyanchor/` folder. Attach the whole
|
|
207
|
+
proof as one small file:
|
|
208
|
+
|
|
209
|
+
```sh
|
|
210
|
+
keyanchor countersign --pq ~/.ssh/id_mldsa44_ed25519 --ref v1.0 --file dist/app.tar.gz
|
|
211
|
+
keyanchor upgrade # once Bitcoin confirmed
|
|
212
|
+
keyanchor bundle && gh release upload v1.0 keyanchor-bundle.json
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Anyone with the download, no clone needed:
|
|
216
|
+
|
|
217
|
+
```sh
|
|
218
|
+
keyanchor verify --bundle keyanchor-bundle.json --file app.tar.gz
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
The bundle is untrusted input like any download: it only carries the statements, signatures and Bitcoin
|
|
222
|
+
proofs, and `verify` judges them exactly as it judges a repository's `.keyanchor/` folder.
|
|
223
|
+
|
|
224
|
+
## Show it on GitHub
|
|
225
|
+
|
|
226
|
+
Add the action to your repository and every push gets a ✅/❌ check with a summary table on the run page:
|
|
227
|
+
|
|
228
|
+
```yaml
|
|
229
|
+
# .github/workflows/keyanchor.yml
|
|
230
|
+
name: keyanchor
|
|
231
|
+
on: [push]
|
|
232
|
+
jobs:
|
|
233
|
+
verify:
|
|
234
|
+
runs-on: ubuntu-24.04
|
|
235
|
+
steps:
|
|
236
|
+
- uses: actions/checkout@v7
|
|
237
|
+
- uses: JustaRsearchGuy/keyanchor@v0.1.0
|
|
238
|
+
# with:
|
|
239
|
+
# refs: HEAD # also require this commit's tree to be countersigned
|
|
240
|
+
# files: dist/app.tar.gz # or these release files
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Then show the badge in your README:
|
|
244
|
+
|
|
245
|
+
```markdown
|
|
246
|
+
[](https://github.com/OWNER/REPO/actions/workflows/keyanchor.yml)
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Pending proofs (the first hours after stamping) pass with a warning; set `fail-on-pending: true` to make
|
|
250
|
+
them fail. The action builds a post-quantum `ssh-keygen` from the pinned, checksum-verified OpenSSH
|
|
251
|
+
release (about a minute) because runner images do not ship one yet.
|
|
252
|
+
|
|
253
|
+
## How it works
|
|
254
|
+
|
|
255
|
+
`.keyanchor/statements/` holds content-addressed statements: canonical JSON named by its SHA-256, one
|
|
256
|
+
`.sig` file per required signature, one `.ots` OpenTimestamps proof. Commit it with your code; it is public
|
|
257
|
+
by design.
|
|
258
|
+
|
|
259
|
+
| Statement | Signed by | Says |
|
|
260
|
+
|---|---|---|
|
|
261
|
+
| `binding` | classical key **and** PQ key | this classical key's holder chose this PQ key |
|
|
262
|
+
| `rotation` | current PQ key **and** new PQ key | authority moves to the new key |
|
|
263
|
+
| `revocation` | the revoked PQ key | this key's authority ends here |
|
|
264
|
+
| `countersign` | the in-force PQ key | these SHA-256 digests of git trees and files are mine |
|
|
265
|
+
|
|
266
|
+
Verification follows [ERC-8373](https://eip.tools/eip/8373)'s anchored key-chain model, adapted to SSH keys,
|
|
267
|
+
and orders everything by **Bitcoin block height** — never by self-declared dates, never by block header
|
|
268
|
+
times (those can go backwards):
|
|
269
|
+
|
|
270
|
+
1. Per classical key, the binding with the earliest anchor wins. Two in the same block: undecidable.
|
|
271
|
+
2. A rotation counts only if anchored after its predecessor and before that predecessor's revocation.
|
|
272
|
+
3. A countersignature counts only if its signer was in force at the countersignature's anchor block.
|
|
273
|
+
4. A binding that embeds a GitHub key snapshot must contain its classical key.
|
|
274
|
+
|
|
275
|
+
Byte-level format and the full algorithm: [docs/SPEC.md](docs/SPEC.md).
|
|
276
|
+
|
|
277
|
+
## What it proves — and what it doesn't
|
|
278
|
+
|
|
279
|
+
- **Proves:** by Bitcoin block *h*, the holder of classical key K declared post-quantum key P (both
|
|
280
|
+
signed), and the key in force vouched for exactly these SHA-256 digests.
|
|
281
|
+
- **Identity:** `--github` embeds your published key list in the signed, anchored statement, so the
|
|
282
|
+
claim survives later key changes and GitHub itself. It is a snapshot *you* took; a signed commit or a
|
|
283
|
+
`--claim dns=…` record you publish corroborates it.
|
|
284
|
+
- **Anchors:** Bitcoin attestations are hash paths into block Merkle roots. Shor's algorithm does not
|
|
285
|
+
apply to hashes; Grover leaves ~128-bit security.
|
|
286
|
+
- **Not proven:** that a person, not just a key, is who GitHub says; that your key was not stolen
|
|
287
|
+
*before* you bound it. And it only protects you with verifiers that enforce these rules — that is why
|
|
288
|
+
the spec is open and the tool is free.
|
|
289
|
+
|
|
290
|
+
## Trust and network
|
|
291
|
+
|
|
292
|
+
| What | Who | Note |
|
|
293
|
+
|---|---|---|
|
|
294
|
+
| Stamping | the 4 public OpenTimestamps calendars | ≥ 2 must answer; the hash you send is blinded with a random nonce |
|
|
295
|
+
| Upgrading | only `*.calendar.opentimestamps.org`, `*.calendar.eternitywall.com`, `*.calendar.catallaxy.com` | a failing calendar is skipped, not fatal |
|
|
296
|
+
| Block headers | one Esplora API (`--explorer`, default blockstream.info) | a lying explorer can mislead you; for high stakes point `--explorer` at your own node (`http://localhost` allowed) |
|
|
297
|
+
| GitHub keys | `api.github.com` / `github.com` | only with `--github` or `--live-github` |
|
|
298
|
+
|
|
299
|
+
Nothing else leaves your machine: no telemetry, no keyanchor server. And no cryptocurrency: keyanchor
|
|
300
|
+
needs no coins, no wallet and no fees. It sends only a hash, the public calendars pay for the Bitcoin
|
|
301
|
+
transaction, and `verify` reads public block headers.
|
|
302
|
+
|
|
303
|
+
Known quirk: macOS's system Python (LibreSSL) cannot complete TLS with `a.pool.opentimestamps.org`; the
|
|
304
|
+
other calendars cover it, so you only see a warning.
|
|
305
|
+
|
|
306
|
+
**Release provenance.** PyPI releases are built and uploaded by
|
|
307
|
+
[`.github/workflows/release.yml`](.github/workflows/release.yml) through Trusted Publishing: no upload
|
|
308
|
+
token exists, and every file carries a Sigstore-signed attestation naming this repository and workflow
|
|
309
|
+
(PyPI shows it as "Provenance" on the release page).
|
|
310
|
+
|
|
311
|
+
## Roadmap
|
|
312
|
+
|
|
313
|
+
What is done, what comes next, and what is deliberately not planned: [docs/ROADMAP.md](docs/ROADMAP.md).
|
|
314
|
+
|
|
315
|
+
## Contributing
|
|
316
|
+
|
|
317
|
+
Bug reports, spec reviews and second implementations are very welcome — see
|
|
318
|
+
[CONTRIBUTING.md](CONTRIBUTING.md). Security issues: [SECURITY.md](SECURITY.md), please not as public
|
|
319
|
+
issues.
|
|
320
|
+
|
|
321
|
+
## License
|
|
322
|
+
|
|
323
|
+
Copyright 2026 JustaRsearchGuy. Licensed under [Apache-2.0](LICENSE); see [NOTICE](NOTICE).
|