Transparent encryption of secrets within files using XChaCha20-Poly1305, with multi-user key management and git integration.
- Marker-based encryption β wrap secrets with
β{secret}oro+{secret}; sss seals them in-place - Multi-user architecture β hybrid X25519 + XChaCha20-Poly1305 encryption; each user holds their own keypair
- Git integration β pre-commit, post-merge, and post-checkout hooks maintain sealed state automatically
- Key derivation β Argon2id with configurable security levels (sensitive / moderate / interactive)
- Deterministic nonces β BLAKE2b-derived nonces produce clean git diffs
- Marker inference β intelligent marker preservation when editing rendered files
- Secrets files β interpolation from
.secretsfiles with YAML-style multi-line values - System keyring β native OS credential storage (macOS Keychain, Windows Credential Manager, Linux Secret Service)
- Emacs integration β
sss-modeprovides transparent decrypt-on-open and re-seal-on-save - FUSE filesystem β mount a project with transparent rendering (Linux/macOS, optional)
- 9P server β network-transparent file access (optional)
- Agent daemon β key caching with policy-based access control (experimental)
git clone <repository-url>
cd sss
cargo build --release
# Binaries are in target/release/Build with FUSE support (Linux/macOS):
# Debian/Ubuntu
sudo apt-get install libfuse3-dev fuse3
# Fedora/RHEL
sudo dnf install fuse3-devel fuse3
# macOS: install macFUSE from https://osxfuse.github.io/
cargo build --features fuse --releaseBuild with 9P server support:
cargo build --features ninep --releasePre-built packages are available via build scripts:
- Debian/Ubuntu β
debian/build-deb.sh - RHEL/CentOS β
rpm-build/build-rpm.sh - Alpine/musl β
Dockerfile.alpine
See docs/INSTALLATION.md for platform-specific instructions including macOS cross-compilation.
-
Generate a keypair
sss keys generate
You will be prompted for a passphrase to protect your private key.
-
Initialise a project
sss init alice
This creates
.sss.tomlin the current directory and adds you as the first user. -
Mark secrets in a file
echo "password=β{my-secret-password}" > config.txt
-
Seal the file
sss seal -x config.txt # config.txt now contains: password=β {base64-ciphertext} -
Open the file
sss open config.txt # Outputs: password=β{my-secret-password}
| Marker | Type | Description |
|---|---|---|
β{content} |
Plaintext | UTF-8 marker (U+2295) |
o+{content} |
Plaintext | ASCII alternative |
β {content} |
Ciphertext | Sealed form (U+22A0), always UTF-8 |
The β and o+ forms are interchangeable on input. After sealing, all markers become β {β¦}.
See docs/marker-format.md for the complete syntax reference including BNF grammar and ciphertext payload layout.
sss seal <file> # Seal plaintext markers (output to stdout)
sss seal -x <file> # Seal in-place
sss open <file> # Unseal to plaintext markers (output to stdout)
sss open -x <file> # Unseal in-place
sss render <file> # Unseal and strip markers (bare secret values)
sss edit <file> # Unseal, open in $EDITOR, re-seal on savesss init [username] # Initialise project
sss status # Show project root
sss seal --project # Seal all files in project
sss open --project # Unseal all files
sss render --project # Render all filessss keys generate # Generate new keypair
sss keys list # List private keys
sss keys pubkey # Show your public key
sss keys rotate # Rotate project key (re-encrypts all files)sss project users list # List project users
sss project users add <user> <pubkey> # Add user (file or base64)
sss project users remove <user> # Remove user (triggers rotation)sss hooks install # Install hooks into current repo
sss hooks list # Show available hooksSee docs/usage-guide.md for complete workflow documentation.
- Each user generates their own keypair with
sss keys generate - Each user shares their public key:
sss keys pubkey > username.pub - The project owner adds each user:
sss project users add <username> <pubkey-file>
All users can then seal and open files independently using their own private key.
See docs/usage-guide.md for the full team collaboration workflow.
Cryptographic primitives:
| Purpose | Algorithm |
|---|---|
| Authenticated encryption | XChaCha20-Poly1305 (via libsodium) |
| Key derivation | Argon2id |
| Key exchange | X25519 (crypto_box_seal) |
| Identity | Ed25519 |
| Nonce derivation | BLAKE2b keyed hash |
What is encrypted: the content inside β{β¦} / o+{β¦} markers only. File structure, key names, and surrounding text are not encrypted.
Nonce design: nonces are derived deterministically from the plaintext and key, which produces clean git diffs but reveals when a secret value changes.
Memory protection: decrypted key material is zeroised on drop via the zeroize crate.
See docs/security-model.md for the full security model including Argon2id parameter levels, threat model, and key hierarchy.
emacs/sss-mode.el (v1.1) is a single-file Emacs package providing transparent encryption for sss-sealed files.
Core behaviour (unchanged from v1.0):
- Sealed files (
β {β¦}) are automatically decrypted on open β plaintextβ{β¦}markers are visible for editing - Re-sealed on save β plaintext never touches disk
- Font-lock highlighting for open and sealed marker forms
- Mode-line indicator (
SSS[open]/SSS[sealed])
New in v1.1:
- Region encrypt/decrypt:
C-c C-e/C-c C-d - Toggle marker state at point:
C-c C-t - Preview decrypted secret at point (transient overlay):
C-c C-v - Overlay mode for visual marker highlighting (
sss-toggle-overlay-mode) - Auth-source integration β passphrase cached via
~/.authinfo(no repeated prompts) - Transient command menu with
completing-readfallback:C-c C-m
Evil integration (when evil is loaded, sss-mode buffers only):
ge/gd/gtβ encrypt / decrypt / toggle operators (compose with any motion)is/asβ inner / outer SSS text objects (use withv,d,c, etc.)
Doom Emacs (when Doom is detected):
SPC eβ global leader prefix for encryption commands, eβ localleader prefix for sss-mode buffers
Installation (vanilla Emacs):
(add-to-list 'load-path "/path/to/sss/emacs/")
(require 'sss-mode)Doom Emacs setup: Copy emacs/sss-mode.el to ~/.config/doom/lisp/, then add to config.el:
(load! "lisp/sss-mode")See docs/sss-mode-guide.md for full installation options, daemon-mode configuration, key binding reference, and troubleshooting.
Mount a project directory with transparent rendering β all files appear as plain text, git operations see the sealed originals.
sss mount <source-dir> <mountpoint>Serve a project over a 9P network socket for cross-platform access.
sss serve9p tcp:0.0.0.0:564sss-agent caches decrypted keys in memory with policy-based access control. Requires SSS_DEVEL_MODE=1.
Requirements: Rust 2024 edition (1.85+), libsodium (linked automatically by libsodium-sys)
cargo test # Run all tests
cargo test --lib # Unit tests only
cargo clippy -- -D warnings # LintingBinaries produced:
| Binary | Description |
|---|---|
sss |
Main CLI tool |
sss-agent |
Key management daemon (Unix) |
sss-askpass-tty |
TTY confirmation helper for agent |
sss-askpass-gui |
GUI confirmation helper for agent |
| Document | Description |
|---|---|
| docs/usage-guide.md | Common workflows: setup, seal/open/edit/render, key management, team collaboration, git hooks |
| docs/configuration.md | Configuration reference: .sss.toml, settings.toml, environment variables |
| docs/security-model.md | Security model: algorithms, key hierarchy, threat model |
| docs/marker-format.md | Marker syntax reference: BNF grammar, ciphertext payload format |
| docs/architecture.md | Technical architecture: processor pipeline, marker inference, FUSE, 9P |
| docs/sss-mode-guide.md | Emacs sss-mode installation and usage |
| ARCHITECTURE.md | Protocol specification |
| SECURITY.md | Security policy and vulnerability disclosure |
| CONTRIBUTING.md | Contribution guidelines |
| CHANGELOG.md | Version history |
| LICENCE | ISC licence |
| docs/CRYPTOGRAPHY.md | Cryptographic implementation details |
| docs/KEY_MANAGEMENT.md | Key management guide |
| docs/SECRETS_FILE_FORMAT.md | Secrets file specification |
| docs/INSTALLATION.md | Detailed installation guide |
ISC β see the LICENCE file for details.
- Built with libsodium for cryptographic operations
- FUSE support via fuser
- 9P server via pfpacket/rust-9p
- Diff algorithm via similar
- Multi-pattern matching via aho-corasick