Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Protocol-Q — a cream paper envelope closed with a teal glass seal

Protocol-Q · Post-quantum file encryption

Protocol-Q lets you send a signed, encrypted file to one recipient. They use their private key to open it and their pinned sender certificate to verify who signed the encrypted envelope. Both commands run locally.

Scan repository keys and certificates · Send your first encrypted file · GitHub Marketplace · Test results

Protocol-Q also inventories checked-in keys and certificates for post-quantum migration planning. Run it in GitHub Actions to review the algorithms it finds and download a SARIF report.

Try the CLI

With Python 3.10+ in an activated virtual environment, run these commands to install the preview and see its two operations, seal and open. The install URL checks the wheel against its published SHA-256 digest.

python -m pip install "https://github.com/AetherAi4/Protocol-Q/releases/download/v0.1.0rc4/aether_protocol_q-0.1.0rc4-py3-none-any.whl#sha256=8745df19d29459ab880a874a8c857d2dd8eada5cbe34331f91b0589b5eef0082"
protocol-q --help

For your first exchange, you’ll also need a qualified OpenSSL build and a way to confirm fingerprints with the other person. The Windows walkthrough takes you from generating disposable keys to opening a sample file. It ends by changing one byte so you can see what a refusal looks like. Follow the walkthrough

Try it without installing OpenSSL (preview)

A second engine, --backend native, needs nothing but pip install. Each person runs five commands: make a virtual environment, step into it, install, make keys, then seal or open. The fingerprint you read to each other is still required on the first send.

python -m pip install "git+https://github.com/AetherAi4/Protocol-Q"
protocol-q keygen --backend native --name alice

Where it stands: on Linux, with OpenSSL 4.1.1 as the referee, all 16 combinations of engine, layout and suite recover the exact file, and the refusal controls hold on both engines. Bouncy Castle, macOS and Windows have not been run against the native engine, it is not on PyPI, and the default engine stays OpenSSL until they have. Preview quickstart · Engine matrix · What was tested, and how

How an exchange works

  1. Enroll the recipient. The recipient creates a key pair and shares the public key. The sender confirms its fingerprint over an independently trusted channel. Both parties keep their private keys locally.
  2. Seal the file. The sender checks the certificate fingerprints, encrypts the file for that recipient, and signs the resulting envelope. The envelope can then travel over the usual file-transfer channel.
  3. Open and verify. The recipient supplies the trusted certificate fingerprints and their private key. Protocol-Q checks the sender’s signature and authenticates the ciphertext before creating the output file.

The complete envelope must fit within 16 MiB, including overhead. Choose a fresh output filename on a filesystem that supports hard links.

Inside the CMS envelope
CMS SignedData                         ML-DSA-65 sender signature
└── CMS AuthEnvelopedData
    ├── Recipient information          ML-KEM-768 → HKDF-SHA-256 → AES-256 key wrap
    └── Encrypted file + tag           AES-256-GCM

RC4 authenticates the envelope signer. When the identity of the original document author matters, verify a signature over the document itself against the expected author’s key. Applications such as Atlas also check the intended audience, current authorization, approved plan, and inner release signature. Wire profile and public fixture · CMS ML-KEM · CMS ML-DSA

For a second, stronger option, --suite cnsa2 uses the CNSA 2.0 parameter sets (ML-KEM-1024, ML-DSA-87), with HKDF-SHA-384 and a SHA-512 signed-attribute digest. A receiver can insist on it with --min-suite cnsa2, which refuses a v1 envelope before decrypting and writes no output. v1 remains the default. Bouncy Castle has not been run against cnsa2 yet; on Linux with OpenSSL 4.1.1, all 14 OpenSSL-to-OpenSSL cells pass. Linux matrix · Suite cnsa2 profile · Downgrade and mixed-suite controls · Provisional matrix

Fingerprints as words or a QR code

Reading the fingerprint to the other person is the one step only people can do, so it should be hard to get wrong. Two other ways to show the same fingerprint:

protocol-q fingerprint bob.pem --words   # 25 words, read in five groups of five
protocol-q fingerprint bob.pem --qr      # a QR code in the terminal (pip install "aether-protocol-q[qr]")

The words come from the published BIP-39 English list (2048 words, MIT), unchanged. Twenty-four words carry the 256-bit fingerprint and the 25th is a checksum. The checksum is built so that one wrong word anywhere, or two different words trading places, is always refused, and nothing is enrolled. This is a property of the construction, and the tests try every single-word change and every swap for sample fingerprints (MEASURED). There is no guessing at a misheard word. The words are not a wallet seed.

--expect on seal, open and enroll takes the hex, the words or the scanned QR text. Every form decodes to the full 32 bytes before it is compared, and the stored value is still the 64-digit hex. Nothing shorter than the whole fingerprint is ever compared.

Whether people make fewer mistakes reading words than hex is NOT RUN: it needs two people. tools/readaloud_trial.py runs the 20-trial test. What was tested, and how

Two separate choices: suite and layout

--suite picks the algorithms. The default suite, v1, uses ML-KEM-768 and ML-DSA-65, which are NIST security category 3. They are not the CNSA 2.0 parameter sets, and protocol-q inventory will say so if you run it on this repository's own v1 fixture. --suite cnsa2 uses ML-KEM-1024 and ML-DSA-87, which are.

--profile picks the wire layout. v1 is the RC4 layout. v2 seals the sender and recipient fingerprints inside the encryption, as described next. Any suite works with either layout, and one test file runs the four v1 and cnsa2 combinations against a real provider, including the re-signing case that v1 accepts and v2 refuses.

A hash-based signature option: suite slh192

--suite slh192 keeps the v1 recipient half (ML-KEM-768) and signs with SLH-DSA-SHA2-192s instead of ML-DSA. SLH-DSA rests on SHA-2 alone, so the signature does not depend on the lattice problems that ML-DSA does. That is the whole reason to pick it. Confidentiality still depends on ML-KEM, and SLH-DSA is not one of the CNSA 2.0 algorithms, so --min-suite cnsa2 refuses it.

What it costs, measured here with a 1 KiB file in the v2 layout: the envelope is 18,897 bytes against 5,982 for v1, the identity file is 46,064 bytes against 13,670, and sealing takes about 0.6 s against 0.03 s. Opening is about as fast as v1.

It runs on the OpenSSL engine only. The Python library behind the native engine has no SLH-DSA yet, so --backend native refuses the suite by name, and fingerprint and enroll need --openssl and --sha256 to check an slh192 identity. Signed attributes must use SHA-512. OpenSSL will produce a valid SHA-256 one if asked, and Protocol-Q refuses it.

Status: built and tested on Linux against OpenSSL 4.1.1 only. No other CMS implementation has opened an slh192 envelope, and it has not run on macOS or Windows. The SHA-512 pin follows the digest table in RFC 9814 §4, and the suite is stricter than the RFC in refusing SHA-384 and digest parameters. Tests · Measured cost · Suite slh192 profile

A pre-shared key layer

If you and the other person already share a secret, --psk-file FILE on both seal and open encrypts the file under a key derived from it before the envelope is built. Someone who later breaks or steals the recipient's ML-KEM key still needs that file to read anything. It needs --profile v2, works with every suite on both engines, and adds 60 bytes.

head -c 32 /dev/urandom > shared.key      # once; get it to the other person some other way
protocol-q seal --to bob --key alice.key --profile v2 --psk-file shared.key report.pdf report.pq
protocol-q open --from alice --key bob.key --profile v2 --psk-file shared.key report.pq report.pdf

The key is the exact bytes of the file, 32 to 1024 of them. The layer is AES-256-GCM under HKDF-SHA-256 of the key, a fresh 32-byte salt and both fingerprints. Whether an envelope carries the layer is recorded inside the encryption, so it cannot be added or stripped in transit: opening a layered envelope without the key is refused, and so is opening an unlayered one with --psk-file.

What it is not: it is a second layer under the CMS envelope, not a combiner inside CMS key derivation, so another CMS tool sees an ordinary envelope whose contents are ciphertext. It does nothing for authorship. And it is only as good as the way you shared and store that file. Status: built and tested on Linux, both engines. Tests · Layer format

Profile v2: the sender is sealed inside

In RC4 the sender's signature sits outside the encryption. Anyone holding an envelope can remove that signature and add their own, so RC4 tells you who signed the envelope and not who wrote the file. Profile v2 puts both certificate fingerprints inside the encrypted file frame. The reader compares them with the pins you supplied before any file is written, and a re-signed envelope is refused.

Select it with --profile v2 on both seal and open. It is opt-in and RC4 stays the default. A v2 reader refuses RC4 envelopes and an RC4 reader refuses v2, with no fallback. It adds about 64 bytes.

Status: qualified on one Windows host against the independent Bouncy Castle peer, with 16 exact recoveries and 116 refusals that wrote no output. The hosted run has not started yet, and no v2 release is published. Wire profile · Acceptance matrix · Receipts · Replay it

Quantum comm ops: a keyed briefing through an IBM device

This is the piece Predator's comm-ops work needed from Protocol-Q: a way for two people to share a mission key with post-quantum protection, and a small keyed check that ties each short message to that mission and to one quantum device.

Predator Quantum Comm Ops animation showing 400 scripted recipients checking their briefings after one IBM hardware job

In Predator’s Gen3 hardware study, 400 scripted recipients verified their briefings on the first try in each of five IBM missions. Each mission used one IBM job and billed 5.0 seconds of quantum-computer time. The Protocol-Q reference construction below was tested on the local FakeFez simulator. Predator hardware results

A briefing is 96 bits: 64 message bits and a 32-bit check. The sender prepares those bits on 96 qubits and measures them. The receiver reads the bits back and accepts the message only if the check matches, the device is the one the mission names, and the mission has not expired.

python -m pip install "aether-protocol-q[ibm] @ git+https://github.com/AetherAi4/Protocol-Q"
protocol-q ibm-probe                      # prints the device's target digest
protocol-q mission new --id demo-01 --target-digest sha256:... --not-after 2027-01-01T00:00:00Z mission.json
protocol-q seal --backend native --profile v2 --to bob.pem --expect "<bob's fingerprint>" --key alice.key mission.json mission.pq
protocol-q mission send mission.json --index 0 --message 0123456789abcdef

mission send runs on IBM's local FakeFez model unless you name a live backend. What this is and is not:

  • It is classical information read from a quantum device. Nothing is transmitted by quantum effects, and nothing here is quantum key distribution.
  • The mission key is the secret. Seal mission.json before it leaves your machine. The --profile v2 layout seals both identities inside.
  • A 32-bit check is small. It catches readout noise and casual tampering. A blind forgery succeeds about once in four billion tries, which is far weaker than a full message authentication code.
  • It is a reference construction. Predator's own deployed check lives in its private software and has not been shown to match this one.

Measured on the local noise model only, ten random messages per row: with one shot, 2 of 10 briefings came back exact and were accepted; with a majority over 8 shots, 10 of 10. A finer search with twenty messages per row found 18, 17, 19, 20 and 20 accepted at 3, 4, 5, 6 and 7 shots, so 6 was the smallest count that got every briefing through. Twenty messages cannot rule out a failure rate of a few percent, and a refused briefing is simply sent again, never accepted wrong. No IBM service or hardware was contacted. Local baseline · Shot search · Tests and fixed vector · Construction

Inventory your keys and certificates

Before you can plan a move to post-quantum algorithms, you need to know what you have. protocol-q inventory walks a folder and lists every key and certificate it can read. For each one it shows the algorithm, its size or curve, and which NSA list names it: in CNSA 2.0, in CNSA 1.0 interim list, or outside the NSA suites. It only reads files. It never opens a network connection and never prints private key material.

python -m pip install ".[inventory]"
protocol-q inventory path/to/repo                 # table
protocol-q inventory path/to/repo --json          # for scripts
protocol-q inventory path/to/repo --sarif --output inventory.sarif

A certificate gets two answers, one for its public key and one for the signature that issued it. A signature counts as on a list only when the scheme, the hash and the signer's key are all on that same list. If the issuing certificate isn't in the scanned folder and the answer depends on it, the tool says "not determined" rather than guessing. Encrypted keys and password-protected keystores are listed as encrypted, not inspected. Files that look like keys but don't parse are counted, not interpreted.

This is a file inventory. It can't see TLS configuration, hardware security modules or cloud key services. Being outside a list says which list an algorithm is on, nothing more.

The lists come from NSA's own documents, not summaries: advisory PP-22-1338 and the CNSA 2.0 FAQ (October 2026). Every entry in rules/cnsa.json cites its document and page. The rules file's version and SHA-256 appear in every report. Ground truth and fixtures · Preregistration

Try a scan on public fixtures

Run these commands from a checkout in an activated virtual environment.

python -m pip install ".[inventory]"
protocol-q inventory fixtures/inventory
Public fixture Example result
certs/mldsa87-root.pem ML-DSA-87 public key in CNSA 2.0
certs/mlkem1024-leaf.pem ML-KEM-1024 public key in CNSA 2.0
keys/p384.encrypted-pkcs8.pem Encrypted, not inspected

Scan your repository with GitHub Actions

Get Protocol-Q Key and Certificate Inventory on GitHub Marketplace. Add this workflow as .github/workflows/crypto-inventory.yml and run Key and certificate inventory from the Actions tab. It shows algorithm classifications in the job summary and saves a SARIF report as a workflow artifact.

name: Key and certificate inventory
on: workflow_dispatch
permissions:
  contents: read
jobs:
  inventory:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v4
      - uses: AetherAi4/Protocol-Q@d6b1e57e53ef7a9943c8720297fed7294defc063 # inventory-v0.1.0
        with:
          upload: 'false'
      - uses: actions/upload-artifact@v4
        with:
          name: crypto-inventory
          path: protocol-q-inventory.sarif
          if-no-files-found: error

On repositories with GitHub code scanning enabled, set upload: 'true' and grant the job security-events: write to see findings under Security → Code scanning. The report includes file paths and algorithm classifications. Set path to limit the scan to a folder. After reviewing the report, you can opt into fail-on: outside to fail the job on an algorithm outside both NSA lists.

If Protocol-Q helps with your migration planning, star the repository to keep it handy. Report an inventory gap or request support for a key format in Discussions.

What we tested

RC4 check Observed result
Windows ↔ Ubuntu Both endpoints recovered the other’s binary file exactly. The Ubuntu guest and Windows host shared one physical workstation. Platform receipt
Independent implementation Bouncy Castle 1.87 opened Protocol-Q envelopes, and Protocol-Q opened Bouncy Castle envelopes. Each Ubuntu wheel/source pairing passed 11 refusal checks. Interop results
Public installation Two fresh Windows environments followed the quickstart. A changed envelope produced no plaintext, and retrying preserved the existing destination. Install receipt

This week's suites, layouts and engines. One script, tools/qualify_lane32.py, runs every suite, layout, engine pairing and refusal control and writes a signed evidence file. On Linux with OpenSSL 4.1.1, 174 of 357 cells pass: every Protocol-Q to Protocol-Q cell, on both engines. The other 183 are Bouncy Castle cells and have not run, because the peer for cnsa2 and slh192 has been written and never compiled. macOS and Windows have not run either. Public fixed vectors for slh192 and the pre-shared key layer ship with a published test key, so anyone can open them. Linux evidence · Vectors · Plan · Run it on another host

Native macOS qualification and an independent two-person exchange on separate machines remain open. Replay RC4 on another host · Release status and checksums

Wire size

In the published Windows OpenSSL 4.1.1 comparison, a 43-byte payload became a 4,982-byte Protocol-Q envelope. For a 1 MiB file, the overhead was 4,954 bytes (0.472%). Sender certificates were provisioned separately. Measured results

Compare the three profiles and inspect the measurements

Why choose this profile? For a package that must stay confidential for years, both the recipient key exchange and the sender signature matter. ML-KEM-768 and ML-DSA-65 target NIST post-quantum security category 3. RSA-3072 and P-256 carry roughly 128 bits of estimated classical strength and are vulnerable to a sufficiently capable quantum computer. All three fixtures encrypt the file bytes with AES-256-GCM. NIST assigns the category to the public-key primitives. The full delivery also depends on enrollment, implementation and key custody. NIST transition guidance, Tables 2–5 · NIST key-management guidance, Table 2

What does that choice cost on the wire? The table shows signed envelope bytes from one Windows OpenSSL 4.1.1 run. Each cell represents the final envelope of two successful fresh round trips on the same public input. Sender certificates were provisioned separately. ECDSA signature encoding can change a P-256 total slightly between runs. Measured results · Reproduce the measurements

Public payload Protocol-Q RSA-3072 / PSS P-256 ECDH / ECDSA
43 B 4,982 B 1,329 B 661 B
4 KiB 9,039 B 5,386 B 4,718 B
1 MiB 1,053,530 B 1,049,877 B 1,049,208 B

The frozen 4,982-byte envelope contains a 3,309-byte ML-DSA signature, a 1,088-byte ML-KEM ciphertext, 43 bytes of encrypted payload and 542 bytes for everything else, including the wrapped key, nonce, GCM tag, signer and recipient identifiers, and DER framing. That explains why the difference is conspicuous on a short message. At 1 MiB, Protocol-Q added 4,954 bytes (0.472% of payload) in this run. Public vector · FIPS 203, Table 3 · FIPS 204, Table 2

Every profile recovered identical bytes and rejected a changed signature, an untrusted signer, a wrong recipient key and a re-signed damaged GCM tag at every measured size. Re-signing the damaged ciphertext makes the last check reach AEAD verification. The separate five-round timing receipt includes four CLI process starts per round and excludes key generation. Timing and rejection counts establish local behavior; estimating cryptanalytic work requires a threat model. Native comparison receipt

For developers

Atlas, Predator, comparison tests, and the optional IBM probe

Installed confidential delivery. The qualified entry points are atlas-delivery deliver/receive and predator ship deliver/receive. They accept a signed verification manifest, a separately supplied target ZIP and host-owned peer and release policies. Four operations agreed on one approved release result. A separate exchange encrypted and recovered the generated ZIP bytes in both directions. A client canary requires fresh evidence from the enrolled recipient. Inner Atlas signing still uses Ed25519. Two-way replay guide · Build pins and tests · Atlas integration · Predator integration

python -m pip install ".[test]"
protocol-q compare --openssl /absolute/path/to/openssl --sha256 APPROVED_DIGEST
protocol-q compare --openssl /absolute/path/to/openssl --sha256 APPROVED_DIGEST --baselines --repeats 5

For pytest, set PROTOCOL_Q_OPENSSL to the trusted absolute executable path and PROTOCOL_Q_OPENSSL_SHA256 to its approved digest. Run python -m pytest -q. Run python -m pytest -q -s tests/test_wire_cost.py to see each profile's measurements at each payload size. Without a configured provider, pytest marks native cases skipped. Classical suites are available only in the comparison harness.

The pinned native provider opened the public RFC 9936 Appendix C reference and rejected its modified tag. A separate installed CLI round trip recovered the target-profile payload. The published reference uses ML-KEM-512. Protocol-Q's own fixtures use ML-KEM-768. Reference receipt · RFC 9936 Appendix C

Optional IBM target probe

python -m pip install ".[ibm,test]"
protocol-q ibm-probe
protocol-q ibm-probe --live-backend ENROLLED_BACKEND_NAME

The default samples a public one-qubit circuit through Qiskit Runtime SamplerV2 on local FakeFez. With a configured account, the live option reads the named target and compiles the circuit. Nano's target fingerprint and instruction validation bind the result to the target inspected. The live path is compile-only. OpenSSL supplies the cryptographic randomness used for delivery.

Source and license

The profile descends from the Atlas Protocol L rehearsal. Nano's target inspection and canonical encoding come from MIT-licensed Nano at a1884e4fbbcb5bf6f4345e5856d0ce1348d8764d. Nano compilation source · Nano notice

The Apache-2.0 distribution covers the files in the CLI release tag, including the Protocol L-derived runtime and generated public vector. This development branch also houses separate Aether integrations and research tooling. Distribution inventory and notices · License

Releases

Packages

Contributors

Languages