# pseudokit

Publish research under a pseudonym now and prove you wrote it later, on your terms.

- **`pseudokit.py`** signs everything twice, with Ed25519 and with SLH-DSA (FIPS 205, hash-based, post-quantum). A check passes only if both signatures verify. Your real identity sits in a salted SHA3-512 commitment that the persona publishes on day one and opens only when you choose.
- **`leakscan.py`** checks a folder or repo for anything that points back to you before the persona publishes it.

Both are single Python files that use only the standard library. They need OpenSSL 3.5 or later; on macOS, `brew install openssl@3` and make sure `openssl version` reports Homebrew's build. Tests: `python3 test_kit.py` (15 tests, about 11 seconds).

## What the cryptography proves, and what it doesn't

| Claim | How | Holds against |
|---|---|---|
| Every release came from the same author | Ed25519 + SLH-DSA signatures by the persona keys in `genesis.txt` | Classical forgers (Ed25519) and quantum forgers (SLH-DSA, which relies only on hash functions) |
| The persona named a specific person from day one | `identity-commitment` in the signed genesis | Anyone trying to attach a different name later: the commitment is binding |
| Nobody can read that name before you reveal it | 32 random bytes of salt, so guessing names is useless | Brute force, including quantum (Grover only halves SHA3-512's 512 bits) |
| The real person agrees | **Not covered by this tool.** The reveal also needs a post from your real-name account (`real-channel-post.txt`). | Without that post, someone could build a persona that "commits" to a famous name |
| When genesis existed | **Not covered by this tool.** Timestamp it: `ots stamp genesis.txt` (OpenTimestamps, Bitcoin-anchored). The `date:` line is self-reported. | Backdating. A signature anchored before quantum computers exist stays credible after they do. |

## Workflow

```bash
export PSEUDOKIT_HOME=~/persona          # public/ and secret/ live here
export PSEUDOKIT_PASS='...'              # optional; otherwise you're prompted. Keys are AES-256 encrypted.

python3 pseudokit.py init --name Wren
python3 pseudokit.py commit --real-name "Your Name" --real-url https://yourblog.example/about
python3 pseudokit.py genesis             # signed public/genesis.txt with the commitment
```

1. **Before the first post:** move `secret/` to encrypted offline storage and set `PSEUDOKIT_SECRET` to its new path. Back up `secret/opening.json` in two places, for example on paper and with a lawyer in escrow. If you lose it you can never claim the work, and anyone who finds it can unmask you.
2. **First post:** publish the whole `public/` folder as the persona's first post, then `ots stamp public/genesis.txt` and publish the `.ots` file too.
3. **Every release:**
   ```bash
   python3 leakscan.py ./release --persona-email wren@users.noreply.github.com
   python3 pseudokit.py manifest ./release --out release.manifest   # SHA-512 of each file, signed
   ots stamp release.manifest
   ```
   In a git repo, `manifest` covers tracked files only and records `HEAD`. It hashes with SHA-512 because git's own commit IDs are SHA-1.
4. **Private proof to one person** (for example a hiring manager): they give you a random nonce, you run `pseudokit.py challenge <nonce>` and send them the JSON, and they run `verify-challenge`. The signed message doesn't contain your name, so even if they forward it, it doesn't connect you to the persona. They know it's you only because you handed it over.
5. **Reveal:** `python3 pseudokit.py reveal --out bundle/`. Post `bundle/real-channel-post.txt` from your real-name account and publish `bundle/` from the persona. Anyone can then check it with `python3 pseudokit.py verify-reveal bundle/ --public <copy of the persona's original public folder>`. The `--public` part matters. Without it, the check only shows that the bundle agrees with itself, and an impostor could make a new persona for the occasion.

Anyone can verify a release with only the persona's public folder:
```bash
python3 pseudokit.py verify-manifest release.manifest --dir ./release --public ./wren-public
```

## leakscan

```bash
mkdir -p ~/.config/pseudokit && $EDITOR ~/.config/pseudokit/deny.txt
python3 leakscan.py PATH... [--persona-email E] [--no-git] [--allow-med]
```

`deny.txt` holds one term per line, matched case-insensitively. Prefix a line with `re:` to make it a regex. List your name, usernames, emails, machine hostnames, employer, collaborators, and internal project names. Keep this file out of every repo, because it's a list of exactly what you're hiding.

| Level | What it flags |
|---|---|
| HIGH | Deny-list terms in any file, file name, binary, metadata, git author or past commit; credentials; a repo `user.email` that isn't the persona's |
| MED | Home-directory paths, email addresses, `*.local` hostnames, PDF/PNG/JPEG metadata (full detail if `exiftool` is installed), notebook outputs, `.DS_Store`, LaTeX `.synctex`/`.fls`/`.log`, non-UTC commit timezones, extra git identities |
| INFO | Hours of the day that commits were made |

The scanner exits 1 if it finds anything HIGH, or anything MED unless you pass `--allow-med`, so you can use it as a pre-push hook.

The scanner can't catch your writing style, topic choice, methods, or hardware. In a small field those identify you more reliably than any file path, and only judgment about what you publish helps there.

## Git settings for the persona's repos

```bash
git config user.name Wren
git config user.email <persona's GitHub noreply address>
TZ=UTC git commit ...          # or: alias gc='TZ=UTC git commit'
```

Even in UTC, the hours you commit can hint at your time zone, so squash or batch commits before pushing. If old commits are already wrong, rewrite them with `git filter-repo` before the first push. Once something is public, assume it has been archived.

## Not handled here

Separate accounts, payment methods, browser profiles and network for the persona; never using employer devices; not following or starring the persona from your real accounts; and your contract. Using a pseudonym doesn't change what your employment agreement lets you publish. A reveal is also a signed admission that you wrote everything the persona published.
