Skip to content

About

Is your code, site, SSH key or Bitcoin quantum-safe? Post-quantum readiness checks for harvest-now-decrypt-later, crypto agility and weak RSA keys. Tiny Rust, no_std core.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

 ██████╗██╗██████╗ ██╗  ██╗███████╗██████╗ ██████╗ ██████╗  ██████╗  ██████╗ ███████╗
██╔════╝██║██╔══██╗██║  ██║██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔═══██╗██╔═══██╗██╔════╝
██║     ██║██████╔╝███████║█████╗  ██████╔╝██████╔╝██████╔╝██║   ██║██║   ██║█████╗
██║     ██║██╔═══╝ ██╔══██║██╔══╝  ██╔══██╗██╔═══╝ ██╔══██╗██║   ██║██║   ██║██╔══╝
╚██████╗██║██║     ██║  ██║███████╗██║  ██║██║     ██║  ██║╚██████╔╝╚██████╔╝██║
 ╚═════╝╚═╝╚═╝     ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚═╝     ╚═╝  ╚═╝ ╚═════╝  ╚═════╝ ╚═╝

00000000: 6369 7068 6572 7072 6f6f 66   cipherproof

Harvest now, decrypt never.
One small binary that tells you whether your sites, keys, code and coins would survive the day the math breaks.
Built at Rivane.

ci no unsafe no_std core dependencies license

cipherproof site output: three hosts ready with X25519MLKEM768, github.com quantum-vulnerable with x25519


Somewhere, right now, someone is recording TLS traffic they can't read yet. They don't need to. They only need to keep it until a large enough quantum computer shows up, and then every session that was protected by plain elliptic-curve key exchange opens like a letter. That is harvest now, decrypt later, and it is why the date that matters is not Q-Day. It is the day your servers started offering a post-quantum key exchange.

The fix already exists. Browsers and the big CDNs negotiate X25519MLKEM768 (classic X25519 plus ML-KEM, FIPS 203) by default. Plenty of servers still don't. cipherproof tells you which side of that line you're on, in one or two network round trips, without a single crypto library.

Install

Grab a signed binary from Releases (Linux, macOS, Windows; x86_64 and ARM64). Every one is built in public CI, and you can check that before running it:

gh attestation verify cipherproof-v0.3.0-<target>.tar.gz --repo lcbasu/cipherproof

Or run the whole check, the way the evidence was produced: scripts/verify-release.sh v0.3.0 <target>. Linux binaries are reproducible, so scripts/reproduce.sh v0.3.0 aarch64 rebuilds one with Docker and compares bytes with the release.

Build from source

git clone https://github.com/lcbasu/cipherproof && cd cipherproof
cargo build --release
./target/release/cipherproof site example.com

Check many hosts at once, or a non-default port, IPv4 or bracketed IPv6:

cipherproof site api.example.com:8443 10.0.0.12 '[2001:db8::1]:443'

What the verdicts mean

Verdict What the server picked What it means for recorded traffic
ready A hybrid or pure ML-KEM group (X25519MLKEM768, SecP256r1MLKEM768, …) Safe against a future quantum computer, and still safe today if ML-KEM ever cracks, because the classical half still holds.
quantum-vulnerable A classical group (x25519, secp256r1, …) or TLS 1.2 Fine today. Readable later by anyone who stored it.
unknown Nothing it would agree to The server refused every group offered. Usually a very old or very strict stack.

When a server prefers a classical group but would accept a post-quantum one if that's all the client offered, cipherproof says so. The verdict is still quantum-vulnerable, because that's what a real browser gets.

A finding: 0 of 162

Of GitHub's 1,000 most-followed developers, 162 publish OpenPGP keys. 151 of them (93.2%) publish an encryption key that's harvestable today, and none of them has a post-quantum one. SSH looks better: 71% of their SSH keys are Ed25519, and only 3 people still list an RSA-1024 key. (Census, method and limits; aggregate counts only, no names.)

Is my Bitcoin exposed?

A quantum computer that can run Shor's algorithm turns a public key into its private key. Most Bitcoin addresses only publish a hash of the key until you spend from them; Taproot (bc1p…) publishes the key itself. Spending from an address and then sending more coins to it again is how keys end up exposed with money behind them.

$ cipherproof btc bc1p0xlx…zk5jj0 1A1zP1eP…DivfNa
bc1p0xlx…zk5jj0   quantum-vulnerable  Taproot: the output is a public key
1A1zP1eP…DivfNa   unknown             P2PKH: the address holds only a hash; use --online to check history

$ cipherproof btc --online 34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo
34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo   quantum-vulnerable  P2SH: key revealed by a past spend, 248597.59313784 BTC exposed
  • It only ever takes an address. Never a private key, never a seed phrase. Anything that asks for those is a scam, whatever it calls itself.
  • Offline by default. The address type alone settles Taproot. --online looks up the history through your system's curl (mempool.space by default, or your own node with --esplora <url>), and says so on stderr, because that server learns which addresses you asked about. The explorer is also trusted for the history it reports; run your own node to remove that trust.
  • It sees one address's history. A key can also be public for other reasons (an old pay-to-public-key output, the same key in another address type), so "ready" means this address hasn't revealed it.
  • The fix today: move coins from exposed addresses to a fresh address that has never been spent from, and don't reuse addresses.

Are my own keys still safe?

$ cipherproof keys id_rsa_1024.pub id_ed25519.pub gnupg25-ed25519-kyber.asc
id_rsa_1024.pub:1                   weak                RSA-1024               sign     weak today: replace now
id_ed25519.pub:1                    quantum-vulnerable  Ed25519                sign     fine until a quantum computer exists; OpenSSH has no post-quantum keys yet
gnupg25-ed25519-kyber.asc primary   quantum-vulnerable  Ed25519                sign     signing: forgeable only once a quantum computer exists; no harvest risk  [lab-ed25519 <lab-ed25519@example.invalid>]
gnupg25-ed25519-kyber.asc subkey 2  ready               ML-KEM hybrid (GnuPG)  encrypt  post-quantum
gnupg25-ed25519-kyber.asc subkey 3  ready               ML-KEM hybrid (GnuPG)  encrypt  post-quantum
gnupg25-ed25519-kyber.asc subkey 4  ready               ML-KEM hybrid (GnuPG)  encrypt  post-quantum
gnupg25-ed25519-kyber.asc subkey 5  quantum-vulnerable  ECDH Curve25519        encrypt  encryption: messages to it can be recorded now and read later; add an ML-KEM subkey (GnuPG 2.5+)

Those are the test keys in crates/core/src/keys/testdata. With no arguments it reads ~/.ssh/*.pub, ~/.ssh/authorized_keys and your own gpg keys (the ones you hold the secret half of; --gpg-all checks the whole keyring). Pass files to check those instead (.pub, authorized_keys, known_hosts, or OpenPGP keys, armored or binary).

  • Public keys only. A file that starts like a private key is refused after its first 64 bytes, before any key material is read. In ~/.ssh only *.pub and authorized_keys are opened.
  • Signing and encryption are different problems. A recorded conversation can't be retroactively forged, so classical signing keys are fine until a quantum computer exists. Encryption keys are different: anything sent to them can be stored today and read later, so those are what to fix first. GnuPG 2.5 can add an ML-KEM subkey today.
  • Understands post-quantum OpenPGP: RFC 9980 (ML-KEM-768+X25519, ML-DSA-65+Ed25519 and friends) and GnuPG 2.5's Kyber subkeys.
  • Exit status 1 means something needs action now: a weak key, or a classical encryption key. Quantum-vulnerable signing keys don't fail it.

Use it as a CI gate

The exit status is the contract:

Exit Meaning
0 Every host is ready
1 At least one host needs action
2 You called it wrong (usage)
3 A check couldn't finish (DNS, timeout, not TLS)

btc treats unknown as needing action too, so an offline run over P2PKH or SegWit addresses exits 1 until you add --online.

# .github/workflows/pq.yml
- run: cargo install --git https://github.com/lcbasu/cipherproof cipherproof
- run: cipherproof site www.example.com api.example.com

How it works (the fun part)

Most scanners find out which key exchange a server supports by actually doing one: generate a key pair, send the share, finish the handshake. That means a crypto library, key generation for every group you want to test, and a few megabytes of binary.

cipherproof asks politely instead.

RFC 8446 lets a client send a ClientHello that lists the groups it supports but contains no key shares at all. The spec is explicit that the client_shares vector "MAY be empty if the client is requesting a HelloRetryRequest" (§4.2.8). A TLS 1.3 server that supports one of the groups then has to answer with a HelloRetryRequest that names the group it wants. That one message is the whole answer. We read it and hang up.

sequenceDiagram
    autonumber
    participant C as cipherproof
    participant S as server:443
    C->>S: ClientHello<br/>supported_groups = [X25519MLKEM768, …, x25519, secp256r1]<br/>key_share = [ ] (empty on purpose)
    alt speaks TLS 1.3 and shares a group
        S-->>C: HelloRetryRequest<br/>selected_group = X25519MLKEM768
        Note over C: group is post-quantum → ready
    else no group in common
        S-->>C: alert(handshake_failure)
        Note over C: try again, see below
    end
    C--xS: close (no keys were ever made)
Loading

No key pair is generated, no secret ever exists, and the server never gets far enough to do any expensive work. The random bytes in the hello only need to be unique, not secret.

A single probe can mislead, so each host gets up to three, always to the same IP address so a CDN can't answer two of them from differently configured edges:

flowchart TD
    A([host:port]) --> R[resolve once,<br/>pin one address]
    R --> P1["probe 1: post-quantum groups first,<br/>then classical"]
    P1 -->|picks ML-KEM hybrid| READY([ready])
    P1 -->|picks classical| P2["probe 2: post-quantum groups only"]
    P2 -->|accepts one| PREF(["quantum-vulnerable<br/>(prefers classical, could do PQ)"])
    P2 -->|refuses| QV([quantum-vulnerable])
    P1 -->|alert| P3["probe 3: also allow TLS 1.2"]
    P3 -->|TLS 1.2 ServerHello| T12(["quantum-vulnerable<br/>(TLS 1.2 only)"])
    P3 -->|still refuses| UNK([unknown])

    classDef good fill:#dafbe1,stroke:#1a7f37,color:#0a3622
    classDef warn fill:#fff8c5,stroke:#9a6700,color:#3b2300
    classDef meh fill:#eaeef2,stroke:#57606a,color:#24292f
    class READY good
    class PREF,QV,T12 warn
    class UNK meh
Loading

I checked every verdict against OpenSSL 4.1 (s_client -groups …, with and without classical fallbacks) on a dozen well-known sites before trusting it. They all agreed. The one that didn't agree at first was a TLS 1.2-only government site, which is why probe 3 exists.

Proof, not claims

Every number in this README comes from a run you can repeat. The evidence folder has screenshots and raw logs: 5 of 5 lab servers with known answers, 25 of 25 public sites agreeing with OpenSSL, the test suite, and the size and memory footprint.

lab: five local OpenSSL servers, five correct verdicts

scripts/lab.sh          # local servers with known answers, no internet
scripts/crosscheck.sh   # public sites vs OpenSSL >= 3.5
scripts/footprint.sh    # size, memory, dependencies, bare-metal builds

The lab runs in CI on every pull request, and the public-site crosscheck reruns every Monday. Both post their output in the proof workflow's job summary.

Built like it handles hostile input, because it does

A tool that reads bytes from arbitrary servers on the internet is an attack surface. So the rules are boring and strict:

flowchart TB
    CLI["cipherproof CLI<br/>std only · 0 dependencies"]
    WASM["browser build<br/>(planned)"]
    MCU["microcontrollers<br/>Cortex-M · RISC-V"]
    subgraph core["cipherproof-core"]
        direction LR
        H["probe ClientHello<br/>writer"] ~~~ P["server reply<br/>parser"] ~~~ G["named groups<br/>→ verdicts"]
    end
    RULES["no_std · no alloc · no unsafe · never panics"]
    CLI --> core
    WASM -.-> core
    MCU -.-> core
    core --- RULES
    classDef rule fill:#ddf4ff,stroke:#0969da,color:#0a3069
    class RULES rule
Loading
  • #![forbid(unsafe_code)] everywhere. Lints deny unwrap, expect, panic! and unchecked indexing outside tests.
  • Every byte read is bounds-checked. The parser returns Incomplete or Malformed, it never panics. Every truncated prefix of a valid reply is tested. The record header is validated before its length is trusted, so an HTTP error page fails fast instead of being read as half a record.
  • Zero dependencies. Cargo.lock has two entries and both are this repo.
  • Small. The release binary is about 400 KB. The core builds for thumbv6m-none-eabi, thumbv7em-none-eabihf, riscv32imc-unknown-none-elf and wasm32-unknown-unknown in CI, so a device can check its own peers.
  • Pinned and audited. Pinned toolchain, actions pinned by commit, MSRV checked, cargo-deny on every PR, and a size budget that fails the build.

Coming next: continuous fuzzing of the parser and Kani proofs that it can't panic, within bounds.

Roadmap

Command Question it answers Status
cipherproof site Will this server's traffic survive harvest-now-decrypt-later? works
cipherproof btc <address> Has this Bitcoin address exposed its public key on-chain? Address only. It will never ask for a seed or a key. works
cipherproof keys Are my SSH and PGP keys still a sensible size and type? works
cipherproof scan . Which algorithms does this codebase use, and what should change first? planned
--json Machine-readable output for dashboards planned

FAQ

Is this an attack tool? No. It sends one ClientHello per probe, the same first message every browser sends, and disconnects. It reads public configuration, nothing else.

Does it need ML-KEM to test ML-KEM? No, that's the trick above. The server tells you its choice before anyone does any cryptography.

Is quantum-vulnerable an emergency? Not today. It means traffic recorded now could be read once a large quantum computer exists. How urgent that is depends on how long your data needs to stay secret. Long-lived secrets, health and financial records, and anything under a 10-year confidentiality rule are the ones to move first.

Why Rust and no crypto crates? Because the safest code to audit is code that isn't there.

Security

Found a bug? Please use Security → Report a vulnerability on this repo rather than a public issue. See SECURITY.md.

License

MIT or Apache-2.0, at your option. Built at Rivane.

About

Is your code, site, SSH key or Bitcoin quantum-safe? Post-quantum readiness checks for harvest-now-decrypt-later, crypto agility and weak RSA keys. Tiny Rust, no_std core.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages