Overview
Thecloudstic key passwd command changes the password for an encrypted repository. This updates the password key slot without re-encrypting any backup data, making password rotation fast and efficient.
Usage
Description
Changing your repository password updates the password key slot by:- Unlocking the master encryption key using your current credentials
- Generating a new random salt for Argon2id key derivation
- Deriving a new wrapping key from the new password
- Re-wrapping the master key with the new wrapping key
- Overwriting the
keys/password-defaultslot
- No data re-encryption — Only the key slot is updated, not your actual backups
- Instant operation — Completes in seconds regardless of repository size
- Preserves other credentials — Platform keys, recovery keys, and KMS keys remain valid
- Forward-only — The old password immediately stops working after the change
Prerequisites
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
The new repository password. If not provided, you will be prompted interactively (recommended for security). The password cannot be empty.
Authentication Flags (Current Credentials)
Your current repository password. Can also be set via
CLOUDSTIC_ENCRYPTION_PASSWORD environment variable. Required if not using platform key or KMS.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. Requires AWS credentials configured via environment or IAM role.Examples
Change password with interactive prompts
- Current repository password (if not provided via flag/env var)
- New repository password
- Confirm new repository password
Change password with flags (non-interactive)
Change password using environment variables
Change password with platform key authentication
- You have access via platform key but want to add/change a password
- You’re migrating from platform key to password-based authentication
- You need to reset a forgotten password using an alternate credential
Change password for remote repository
Change password with KMS authentication
Password Requirements
Cloudstic does not enforce specific password complexity requirements. Choose a strong password using best practices: length (20+ characters), randomness, or a passphrase (5+ words).
Recommended Password Strategies
Diceware Passphrase (recommended):- 6 random words from wordlist
- ~77 bits of entropy
- Easy to remember, hard to crack
- 20+ mixed characters
- ~120 bits of entropy
- Store in password manager
Password Storage Recommendations
- Password managers — 1Password, Bitwarden, KeePassXC, etc.
- Offline backup — Write down and store securely (safe, lockbox)
- Recovery key — Generate with
key add-recoveryfor additional backup
Interactive vs Non-Interactive Mode
Interactive Mode (Recommended)
If you runcloudstic key passwd without providing current and new passwords via flags:
- Passwords not visible in process list or shell history
- Confirmation prompt prevents typos
- No plaintext password files required
- Current password (masked input)
- New password (masked input)
- Confirm new password (masked input)
Non-Interactive Mode
Provide passwords via flags:- Automation/scripting (CI/CD, cron jobs)
- Non-TTY environments (Docker, remote execution)
- Programmatic password rotation
- Use environment variables instead of CLI flags when possible
- Clear history after execution:
history -c - Use process isolation (containers, sandboxes)
Key Slot Behavior
What Changes
✅ Updated:keys/password-defaultslot is overwritten- New Argon2id salt is generated (32 random bytes)
- New KDF parameters may be applied (if defaults changed)
- Wrapped master key is re-encrypted with new wrapping key
- Master encryption key remains the same
- All backup data remains encrypted with the same key
- Platform key, recovery key, and KMS key slots are untouched
- Other credentials continue working normally
After Password Change
- Old password immediately stops working for all operations
- New password is required for future unlocks (backup, restore, list, etc.)
- Alternative credentials (recovery key, platform key, KMS) still work
If you have the repository mounted or clients running, they will continue using their cached encryption key until they restart. The password change takes effect for new sessions.
Argon2id Parameters
The new password slot uses Argon2id key derivation with the following default parameters:- Algorithm: Argon2id (hybrid mode, resistant to side-channel and GPU attacks)
- Time (iterations): 3
- Memory: 65536 KB (64 MB)
- Threads: 4
- Salt: 32 random bytes (unique per password change)
Performance Impact
Argon2id key derivation takes approximately:- ~300-500ms on modern CPUs (with default parameters)
- 64 MB RAM per unlock operation
- 4 CPU threads (parallelizable)
Error Messages
Repository not initialized
cloudstic init before changing passwords.
Repository is not encrypted
--no-encryption) don’t have passwords. You cannot add encryption after initialization.
Failed to unlock repository
- Password is typed correctly (check Caps Lock)
- Platform key matches the
keys/platform-defaultslot - KMS key ARN is correct and IAM permissions allow decryption
Passwords do not match
Empty password
Missing credentials
Use Cases
Routine password rotation
Suspected compromise
Migration from platform key to password
Reset forgotten password using recovery key
Automation/scripting
Security Considerations
When to Change Your Password
✅ Change immediately if:- You suspect compromise (malware, phishing, data breach)
- Shared password with someone who no longer needs access
- Password was transmitted insecurely (email, chat, unencrypted channel)
- Device with stored password was lost or stolen
- Every 90-180 days as routine maintenance
- After team member departures
- During security audits
Does Changing Password Re-Encrypt Data?
No. Cloudstic uses envelope encryption:- Master key — Random 32-byte key generated during
init(never changes) - Wrapping key — Derived from your password via Argon2id
- Wrapped master key — Stored in the password key slot
- Data encryption key — Derived from master key via HKDF
keys/password-default slot. The master key stays the same, so all your backup data remains valid without re-encryption.
Revoking Access
Changing the password does not revoke access for:- Users with the recovery key (still valid)
- Users with the platform key (still valid)
- Users with KMS access via IAM policies (still valid)
- Users with the master key cached in running processes
- Change the password (locks out old password)
- Ensure no other key slots exist (or rotate those too)
- Verify no running processes have cached keys
Multiple Credentials
If your repository has multiple credential types:password slot. The recovery and platform slots remain unchanged. Anyone with the recovery key or platform key can still access the repository.
Global Options
-store,-store-path,-store-prefix— Specify repository location-s3-*,-sftp-*, etc. — Storage backend configuration-debug— Log detailed operations
Related Commands
cloudstic key list— List all key slots (verify password slot exists)cloudstic key add-recovery— Generate recovery key (password-independent backup)cloudstic init— Initialize repository with initial passwordcloudstic cat— View raw key slot JSON objects (cat keys/password-default)
Technical Details
Password Wrapping Process
- Unlock master key using current credentials
- Generate salt (32 random bytes via
crypto/rand) - Derive wrapping key from new password:
- Wrap master key with AES-256-GCM:
- Store wrapped key at
keys/password-default:
Key Slot Overwrite
The command overwrites the existingkeys/password-default object. This is atomic at the object store level (S3, B2, etc.). There is no period where both old and new passwords work simultaneously.