Overview
Thecloudstic key add-recovery command generates a BIP39 24-word mnemonic recovery key for an existing encrypted repository. This recovery key provides a human-readable backup method to unlock your repository if you lose your primary password or platform key.
Usage
Description
A recovery key is a 24-word seed phrase (BIP39 mnemonic) that encodes a 32-byte cryptographic key. This key is used to wrap your repository’s master encryption key in a new “recovery” key slot. Why use a recovery key?- Password backup — If you forget your password, the recovery key provides an alternative unlock method
- Disaster recovery — Store the recovery key offline (printed, engraved, etc.) for long-term backup
- Access delegation — Share repository access without revealing your primary password
- Migration — Simplifies moving access between systems or team members
Prerequisites
To add a recovery key, you must already have access to the repository using one of:-encryption-password— Your current repository password-encryption-key— Your platform key (64 hex characters)-kms-key-arn— AWS KMS key ARN (for KMS-encrypted repositories)
Flags
Current repository password (required to unlock the master key). Can also be set via
CLOUDSTIC_ENCRYPTION_PASSWORD environment variable.Platform key as 64 hex characters (alternative to password). Can also be set via
CLOUDSTIC_ENCRYPTION_KEY environment variable.AWS KMS key ARN for unlocking KMS-encrypted repositories. Can also be set via
CLOUDSTIC_KMS_KEY_ARN environment variable.Examples
Add recovery key using password authentication
Add recovery key using environment variable
Add recovery key with platform key
Add recovery key for KMS-encrypted repository
Recovery Key Format
The recovery key is a BIP39 mnemonic consisting of 24 words from the standard BIP39 English wordlist. The words encode 256 bits of entropy (32 bytes) plus an 8-bit checksum. Example recovery key:The recovery key uses the same BIP39 standard as cryptocurrency wallets, but does not derive keys using BIP32/BIP44. It directly encodes a 32-byte wrapping key.
Storing Your Recovery Key
Best Practices
- Write it down immediately — The key is displayed only once and never stored
- Verify the words — Double-check spelling and order before storing
- Use physical storage — Paper, metal plates, or engraved media (not digital)
- Multiple copies — Store in 2-3 geographically separated locations
- Consider splitting — Use Shamir’s Secret Sharing for critical data
- Protect from fire/water — Use fireproof/waterproof containers
- Test recovery — Verify you can unlock the repository with the recovery key
Storage Ideas
- Home safe — Fireproof/waterproof safe or lockbox
- Bank safety deposit box — Offsite secure storage
- Trusted family member — Sealed envelope with instructions
- Metal plate — Engraved or stamped for durability
- Cryptosteel/Billfodl — Purpose-built metal backup solutions
Using the Recovery Key
To unlock a repository with your recovery key:Multiple Recovery Keys
Currently, Cloudstic supports one recovery key slot per repository (label: “default”). Runningkey add-recovery multiple times will overwrite the previous recovery key slot.
To maintain multiple recovery methods, use different credential types (password + recovery + platform key).
Error Messages
Repository not initialized
cloudstic init before adding keys.
Repository is not encrypted
--no-encryption) don’t need key slots.
Failed to extract master key
-encryption-password, -encryption-key, or -kms-key-arn. Your credentials must match an existing key slot.
Missing credentials
Security Considerations
Threat Model
- Recovery key is equivalent to your password — Anyone with the 24 words can decrypt all your backups
- Physical security matters — The key should be protected like cash or jewelry
- Social engineering risk — Never share the key via phone, email, or messaging apps
- Inheritance planning — Store instructions with the key for trusted individuals
When to Generate a Recovery Key
✅ Good use cases:- Long-term personal backups where password loss is a concern
- Disaster recovery scenarios (house fire, computer theft, etc.)
- Compliance requirements for offline key escrow
- Shared access scenarios (family, team, organization)
- You can’t secure physical storage (risk of theft/exposure)
- You only need short-term backups (recovery key is overkill)
- Your threat model requires defense against physical compromise
Global Options
-store,-store-path,-store-prefix— Specify repository location-s3-*,-sftp-*— Storage backend configuration-debug— Log detailed operations
Related Commands
cloudstic init— Initialize repository with-recoveryflag to generate recovery key during setupcloudstic key list— Verify recovery key slot was addedcloudstic key passwd— Change repository password (recovery key remains valid)cloudstic restore— Restore backups using recovery key
Technical Details
Key Generation Process
- Generate 256 bits (32 bytes) of cryptographic entropy via
crypto/rand - Encode entropy as BIP39 mnemonic using standard wordlist
- Unlock repository master key using provided credentials
- Wrap master key with BIP39-derived key using AES-256-GCM
- Store wrapped key in
keys/recovery-defaultslot - Display mnemonic to user (this is the only time it’s shown)
BIP39 Implementation
Cloudstic uses the standard BIP39 English wordlist (2048 words). The 24-word mnemonic encodes:- 256 bits of entropy
- 8-bit checksum (derived from SHA256 of entropy)
Storage Location
The recovery key slot is stored as JSON atkeys/recovery-default:
kdf_params is omitted because BIP39 doesn’t require parameters (the wordlist and algorithm are standardized).
Legacy Command
The standalone
cloudstic add-recovery-key command is deprecated. Use cloudstic key add-recovery instead. The old command still works but prints a deprecation notice.