Quantum-resistant proxy recryption CLI
Recrypt enables end-to-end encrypted file storage and sharing where files can be shared and revoked cryptographically—without ever sharing keys.
# 1. Create your first identity
recrypt identity new --name alice
# 2. Configure your server
recrypt config set default_server http://localhost:7222
# 3. Register on the server
recrypt account register
# 4. Encrypt and upload a file
recrypt encrypt secret.txt --for alice --output secret.enc
recrypt file upload secret.enc
# 5. Share with Bob (who has registered)
recrypt share create <file-hash> --to <bob-fingerprint>- Installation
- Core Concepts
- Identity Management
- Local Encryption
- Server Operations
- File Sharing
- Configuration
- Environment Variables
- Output Formats
- Wallet Security
- Troubleshooting
cd recrypt
cargo build --release
# Binary at: target/release/recryptrecrypt --version
recrypt --helpAn identity is a set of cryptographic keypairs:
- ED25519 — Classical digital signatures
- ML-DSA-87 — Post-quantum digital signatures
- PRE — Proxy re-encryption keys (enables sharing)
Each identity has a fingerprint (blake3(ed25519_public_key) → base58), which serves as your public identifier.
Traditional encryption: Alice encrypts for Bob, Bob decrypts. If Alice later wants Carol to access, she must re-encrypt with Carol's key.
Proxy recryption: Alice encrypts once. To share with Bob, she generates a recrypt key (Alice→Bob). A proxy server can transform ciphertexts for Bob without seeing the plaintext. Revocation = delete the recrypt key.
Your identities are stored in an encrypted wallet file:
- macOS:
~/Library/Application Support/io.identikey.recrypt/wallet.ikeyw - Linux:
~/.local/share/recrypt/wallet.ikeyw - Windows:
C:\Users\<user>\AppData\Roaming\identikey\recrypt\wallet.ikeyw
The wallet is encrypted with a password-derived key (Argon2id). On subsequent runs, the key is cached in your OS keychain (macOS Keychain, Linux Secret Service, Windows Credential Manager) so you don't have to re-enter it.
# Auto-named (identity-1, identity-2, etc.)
recrypt identity new
# Named identity
recrypt identity new --name aliceThe first identity created becomes the active identity.
recrypt identity listOutput:
Identities:
★ alice (2YzWq8...)
bob (5XjKm9...)
The star (★) marks the active identity.
# Active identity
recrypt identity show
# Specific identity
recrypt identity show --name bobrecrypt identity use bobThe active identity is used for all operations unless overridden with --identity.
recrypt identity delete bob# Export (includes secret keys!)
recrypt identity export alice --output alice-backup.json
# Import
recrypt identity import alice-backup.json --name alice-restoredEncrypt and decrypt files locally without involving a server.
# Encrypt for yourself
recrypt encrypt document.pdf --for alice
# Encrypt for another identity in your wallet
recrypt encrypt document.pdf --for bob
# Custom output path
recrypt encrypt document.pdf --for alice --output encrypted/document.encDefault output: <filename>.enc
# Uses active identity
recrypt decrypt document.enc
# Specific identity
recrypt decrypt document.enc --identity alice
# Custom output
recrypt decrypt document.enc --output restored.pdfDefault output: strips .enc suffix, or appends .decrypted
recrypt config set default_server http://localhost:7222Or use the --server flag per-command:
recrypt account register --server http://prod.example.com:7222Before uploading files or sharing, register your identity:
recrypt account registerThis uploads your public keys to the server. Secret keys never leave your machine.
# Your account
recrypt account show
# Someone else's account (by fingerprint)
recrypt account show 2YzWq8...recrypt file upload document.encReturns the file hash (content address):
✓ Uploaded document.enc
Hash: 4xNvKp9...
# To default path (<hash>.bin)
recrypt file download 4xNvKp9...
# Custom output
recrypt file download 4xNvKp9... --output document.encrecrypt file listrecrypt file delete 4xNvKp9...The magic of proxy recryption: share encrypted files without re-encrypting or sharing keys.
# Get recipient's fingerprint first
recrypt account show <bob-fingerprint>
# Create share
recrypt share create <file-hash> --to <bob-fingerprint>This:
- Generates a recrypt key (your secret → Bob's public)
- Uploads the recrypt key to the server
- Returns a share ID
Bob can now download the file, and the server will transform the ciphertext so Bob can decrypt it.
# All shares
recrypt share list
# Only outgoing (files you shared)
recrypt share list --from
# Only incoming (files shared with you)
recrypt share list --toWhen someone shares a file with you:
recrypt share download <share-id>
# Custom output
recrypt share download <share-id> --output received.encThe server applies the recrypt transformation, and you can decrypt with your own keys.
recrypt share revoke <share-id>The recrypt key is deleted. The recipient can no longer access the file (even if they previously downloaded it, they can't get new versions or re-download).
Configuration is stored in:
- macOS:
~/Library/Application Support/io.identikey.recrypt/config.toml - Linux:
~/.config/recrypt/config.toml - Windows:
C:\Users\<user>\AppData\Roaming\identikey\recrypt\config.toml
recrypt config showrecrypt config set <key> <value>| Key | Description | Example |
|---|---|---|
default_server |
Server URL for API operations | http://localhost:7222 |
active_identity |
Active identity — managed via recrypt identity use <name>, not set directly |
alice |
output_format |
Default output format | pretty or json |
wallet_path |
Custom wallet file location | /path/to/wallet.ikeyw |
default_backend |
PRE backend for new identities | lattice or mock |
Override configuration with environment variables:
| Variable | Description |
|---|---|
RECRYPT_SERVER |
Server URL |
RECRYPT_IDENTITY |
Identity name |
RECRYPT_WALLET |
Wallet file path |
RECRYPT_WALLET_PASSWORD |
Wallet password (for CI/scripting) |
RECRYPT_BACKEND |
PRE backend: lattice or mock |
RECRYPT_DEBUG |
Enable debug logging (1 or true) |
RECRYPT_CONFIG_DIR |
Override config directory location (useful for testing/CI) |
RECRYPT_NO_KEYCHAIN |
When set, disables OS keychain and uses in-memory credential storage |
Example:
RECRYPT_SERVER=http://prod:7222 recrypt file listHuman-readable, colored output:
recrypt identity listMachine-readable JSON:
recrypt --json identity listOr set as default:
recrypt config set output_format jsonUseful for scripting:
recrypt --json identity show | jq '.fingerprint'# Unlock wallet (prompts for password, caches key)
recrypt wallet unlock
# Lock wallet (clears cached key)
recrypt wallet lock
# Check wallet status
recrypt wallet status
# Show wallet file path
recrypt wallet pathYour wallet is encrypted with Argon2id key derivation. Choose a strong password.
After entering your password once, the derived key is cached in your OS keychain:
- macOS: Keychain Access
- Linux: GNOME Keyring / KWallet via Secret Service API
- Windows: Credential Manager
Subsequent commands won't prompt for a password until you reboot or the cache expires.
For automated environments, set the wallet password via environment variable:
export RECRYPT_WALLET_PASSWORD=your-wallet-password
recrypt identity listcp ~/Library/Application\ Support/io.identikey.recrypt/wallet.ikeyw ./wallet-backup.ikeywOr export individual identities:
recrypt identity export alice --output alice-backup.json# Set an active identity
recrypt identity use alice
# Or specify per-command
recrypt --identity alice file listEnsure your home directory is accessible. On unusual systems, use explicit paths:
RECRYPT_WALLET=/tmp/wallet.ikeyw recrypt identity newThe cached key may be stale. Clear it and re-enter your password:
- macOS: Delete "recrypt-wallet-key" in Keychain Access
- Linux: Use
secret-tool clear service recrypt
The wallet on disk uses the legacy JSON-in-XChaCha20-Poly1305 format. There is no migration path — back up the file if you need it, then create a fresh wallet:
recrypt identity newThe current format is the Gordian Envelope (dCBOR) wallet body documented in
docs/standards/wallet-envelope-format.md.
- Check server is running:
curl http://localhost:7222/health - Verify URL:
recrypt config show - Check network/firewall
The recipient must have registered their account before you can share with them:
# Recipient runs:
recrypt account registerAlice (sender):
# Setup
recrypt identity new --name alice
recrypt config set default_server http://server:7222
recrypt account register
# Encrypt and upload
recrypt encrypt secret.pdf --for alice
recrypt file upload secret.pdf.enc
# → Hash: 4xNvKp9...
# Share with Bob (get his fingerprint first)
recrypt share create 4xNvKp9... --to 5XjKm9...
# → Share ID: abc123Bob (recipient):
# Setup
recrypt identity new --name bob
recrypt config set default_server http://server:7222
recrypt account register
# Download shared file
recrypt share list --to
# → Share ID: abc123
recrypt share download abc123 --output secret.enc
# Decrypt
recrypt decrypt secret.enc --output secret.pdfAlice (revoke access):
recrypt share revoke abc123
# Bob can no longer access the filerecrypt [OPTIONS] <COMMAND>
Options:
--json Output as JSON
--identity <NAME> Override active identity
--server <URL> Override server URL
--wallet <PATH> Override wallet path
--backend <NAME> PRE backend: "lattice" (default) or "mock"
--debug Enable debug logging
-v, --verbose Verbose output
-h, --help Print help
-V, --version Print version
Commands:
identity Manage identities (new, list, show, use, delete, export, import)
encrypt Encrypt a file locally
decrypt Decrypt a file locally
account Manage server account (register, show)
file Manage files on server (upload, download, list, delete)
share Manage file shares (create, list, download, revoke)
config Manage configuration (show, set)
wallet Manage wallet (unlock, lock, status, path)
Questions? Open an issue or check the API documentation in docs/api-reference.md.