Terraphim AI Update Signing Keys
This document describes how Terraphim AI release binaries are cryptographically signed and how to verify the authenticity of downloaded updates.
Overview
Terraphim AI uses Ed25519 signatures to verify that downloaded update binaries are authentic and have not been tampered with. Ed25519 is a modern elliptic curve signature scheme that provides:
- Strong security: 128-bit security level (equivalent to 3000-bit RSA)
- Fast verification: Optimized for quick verification on all platforms
- Small signatures: 64-byte signatures (much smaller than RSA/PGP)
- No key confusion: Ed25519 prevents signature ambiguity attacks
Public Key Distribution
Primary Method: Embedded Public Key
The Ed25519 public key is embedded directly in the Terraphim AI binary at compile time:
Location: crates/terraphim_update/src/signature.rs
How it works:
- The public key is compiled into the binary during the build process
- When checking for updates, the binary verifies signatures using this embedded key
- No external key files or configuration needed
- Key cannot be modified without recompiling the binary
Alternative Methods (for advanced users)
1. Environment Variable Override
For testing or emergency key rotation, you can override the embedded key:
2. Configuration File
Some installations may support specifying a custom public key in the configuration file (check your specific deployment documentation).
Key Generation Process
Terraphim AI maintainers generate Ed25519 key pairs using the zipsign tool:
Generating a New Key Pair
# Run the provided key generation script
This generates:
keys/private.key- SECRET signing key (store securely!)keys/public.key- Public verification key (embed in code)
Private Key Storage
IMPORTANT: The private signing key is stored securely using 1Password or equivalent password manager.
Security practices:
- Private key is never committed to git
keys/directory is in.gitignore- Only trusted maintainers have access to the signing key
- Key is rotated if compromised or periodically (e.g., annually)
Signature Format
Terraphim AI uses embedded signatures rather than separate signature files:
Archive Signatures
- TAR.GZ files: Signature stored in GZIP comment field
- TAR.ZST files: Signature stored in Zstandard comment field
- ZIP files: Signature prepended to the archive
Advantages:
- No separate
.sigfiles to download - Signatures travel with the archive
- Cannot accidentally download archive without signature
- Simpler distribution process
Verification Process
When you download a Terraphim AI update:
- Binary downloads the release archive (
.tar.gz) - Signature verification reads the embedded signature from the archive
- Verification uses the embedded Ed25519 public key
- Archive is installed only if signature is valid
Failure modes:
- β Invalid signature β Update rejected, security warning logged
- β Missing signature β Update rejected
- β Verification error β Update rejected
Verifying Downloaded Archives Manually
You can manually verify a downloaded archive using the zipsign CLI:
Installing zipsign
# Install from crates.io
# Or build from source
Extracting the Public Key
The public key is available in the source code:
# Extract from source code
Verifying an Archive
# Verify a downloaded archive
# Expected output:
# Signature by KEY_ID verified successfullyKey Rotation
Planned Rotation (v1.1+)
Future versions will support multiple trusted public keys to enable smooth key rotation:
Emergency Rotation
If the signing key is compromised:
- Immediate: Revoke compromised key in next release
- Generate: Create new key pair using secure environment
- Update: Embed new public key in code
- Release: Sign new release with new key
- Announce: Publish security advisory with key fingerprint
Key Fingerprint
Each Ed25519 public key has a unique fingerprint (SHA-256 hash):
# Calculate fingerprint
echo -n "PUBLIC_KEY_BASE64" | base64 -d | sha256sumTerraphim AI Official Keys:
| Key Version | Fingerprint (SHA-256) | Valid From | Status |
|-------------|----------------------|------------|--------|
| v1.0 | 1c78db3c8e1afa3af4fcbaf32ccfa30988c82f9e7d383dfb127ae202732b631a | 2025-01-12 | Active |
Public Key (base64-encoded):
1uLjooBMO+HlpKeiD16WOtT3COWeC8J/o2ERmDiEMc4=Key Location: Embedded in crates/terraphim_update/src/signature.rs
Security Considerations
Threat Model
Signature verification protects against:
- β Man-in-the-middle attacks on downloads
- β Compromised download servers/CDNs
- β Malicious actors modifying binaries
- β Supply chain attacks during distribution
Signature verification does NOT protect against:
- β Vulnerabilities in the binary itself
- β Compromised build systems (signs malicious code)
- β Developer account compromise (if they have signing key access)
Best Practices for Users
- Always verify signatures before installing updates
- Check key fingerprints match official announcements
- Report suspicious signature failures to security team
- Keep your Terraphim AI binary updated to get latest keys
- Never disable signature verification in production
Best Practices for Maintainers
- Generate keys on air-gapped or secure systems
- Store private keys in password managers (1Password, etc.)
- Rotate keys periodically or immediately after compromise
- Document all key rotations with proper announcements
- Audit signing scripts and CI/CD pipelines regularly
- Use hardware security modules (HSMs) for production signing
Trust Model
Developer Trust
Users trust that:
- Terraphim AI developers have secured the signing private key
- Build systems are not compromised
- Signed binaries match source code (reproducible builds)
Verification Trust
Users verify that:
- Downloaded binaries have valid signatures
- Signatures match the embedded public key
- Public key is from official Terraphim AI sources
Troubleshooting
Signature Verification Fails
Error: "Signature verification failed"
Possible causes:
- Archive was corrupted during download
- Archive was modified after signing
- Wrong public key (embedded key mismatch)
- Expired key (if rotation implemented)
Solutions:
- Re-download the archive
- Verify your binary is from official sources
- Check for security advisories about key rotation
- Report the issue if problem persists
Missing Signature
Error: "No signature found in archive"
Possible causes:
- Downloaded unsigned development build
- Archive from unofficial source
- Incomplete download
Solutions:
- Download official release from GitHub releases
- Verify you're using the correct download URL
- Check release notes for signature availability
References
- Ed25519 Paper - Cryptography paper by Bernstein et al.
- zipsign Documentation - Signing tool used
- Issue #421 - Original implementation issue
- SIGNATURE_VERIFICATION_PROGRESS.md - Implementation progress
Contact
For security-related questions about signature verification:
- Security Issues: [email protected]
- General Questions: GitHub Discussions
- Report Verification Failures: GitHub Issues with "security" label
Last Updated: 2025-01-12 Document Version: 1.0