Skip to main content
Cloudstic uses AES-256-GCM encryption by default. This guide explains how to manage encryption credentials, add recovery keys, change passwords, and understand the key slot system.

Understanding Cloudstic Encryption

Cloudstic’s encryption model:
  • A random 32-byte master key is generated during cloudstic init
  • The master key encrypts all backup data
  • The master key itself is wrapped into one or more key slots
  • Each slot is unlocked with different credentials (password, platform key, KMS key, or recovery phrase)
  • All slots unlock the same master key
Think of key slots like multiple keys to the same safe. You can unlock your backups with any valid credential.

Key Slot Types

Creating a Repository with Encryption

Password-Based Encryption

Most common for personal use:
Use a strong, unique passphrase. Consider using a passphrase manager like 1Password, Bitwarden, or LastPass.
Add a recovery key during initialization:
Output:
Write down your recovery key immediately! It will only be displayed once. Store it in a safe, offline location (physical safe, safety deposit box, etc.).

Platform Key for Automation

Use a raw encryption key for non-interactive systems:
Platform keys are intended for automation where password prompts aren’t possible. Store them in a secrets manager (HashiCorp Vault, AWS Secrets Manager, etc.).

Dual Access (Password + Platform Key)

Create a repository with both types of access:
Now you can unlock the repository with either credential.

Listing Key Slots

View all key slots in a repository:
Output:
key list does not require authentication. Slot metadata is stored unencrypted.

Adding a Recovery Key

Add a recovery key to an existing repository:
Output:
This is the only time the recovery key is displayed. Write it down and store it securely.
If you’re using a platform key instead of a password:
For KMS-managed repositories:

Changing Your Password

Update the password slot:
You’ll be prompted for:
  1. Current password (or provide via -password)
  2. New password (or provide via -new-password)
  3. Confirmation of new password
Non-interactive example:
If you’re unlocking with a platform key or KMS key, you can use those to set a new password:

Using Recovery Keys to Access Backups

If you’ve lost your password, use your recovery key:
Or set it as an environment variable:
Once you’ve regained access, set a new password:

Environment Variables for Credentials

Avoid typing credentials repeatedly:
Add to your shell profile (~/.bashrc, ~/.zshrc) for persistence:
Security consideration: Only store credentials in environment variables on trusted, single-user systems. For shared systems, enter passwords interactively.

Store-Level Encryption Configuration

When using profiles, encryption settings can be stored on the store entry using secret references. Only the reference is saved, never the secret value itself:
In interactive mode, store new guides you through encryption setup if no encryption flags are provided:
The chosen settings are saved to profiles.yaml as secret references. You can then initialize the store immediately or later with cloudstic init -profile <name>. This saves to profiles.yaml:
Supported secret reference schemes:
  • env://VAR_NAME
  • keychain://service/account
  • wincred://target
  • secret-service://collection/item
At backup time, Cloudstic resolves the secret reference and uses the returned value. The KMS ARN is stored directly since it’s not a secret.
Store-level encryption settings are applied automatically when you use -profile. CLI flags always take precedence if you need to override them.

Interactive Password Prompts

If no credential is provided, Cloudstic will prompt interactively:
This is the most secure option for personal use.

Advanced: AWS KMS Integration

For enterprise deployments, use AWS KMS to manage encryption keys:
1

Create a KMS key

Note the KeyId from the output.
2

Initialize repository with KMS

3

Use KMS for all operations

KMS integration requires AWS credentials with kms:Decrypt and kms:GenerateDataKey permissions.

Security Best Practices

1

Use strong, unique passphrases

  • At least 20 characters
  • Mix of words, numbers, and symbols
  • Not reused from other services
  • Consider using a passphrase generator
2

Always create a recovery key

3

Store recovery keys offline

  • Write on paper, store in a safe
  • Use a safety deposit box
  • Split across multiple secure locations
  • Never store digitally alongside backups
4

Test recovery key access

Verify your recovery key works:
5

Rotate passwords periodically

Recommended: every 6-12 months
6

Use KMS for production systems

Leverage hardware security modules for enterprise deployments:

Troubleshooting

”Could not open key slots” Error

Your password or key is incorrect. Verify:

“Repository not encrypted” Message

The repository was created with -no-encryption. Key management commands don’t apply to unencrypted repositories.

Lost Password and Recovery Key

There is no recovery option if both are lost. Your backups are permanently inaccessible. This is by design: encryption without a backdoor. Preventive measures:
  • Always create a recovery key (-add-recovery-key)
  • Store recovery key in multiple secure locations
  • Document your encryption setup

Changing Password Doesn’t Work

Ensure you’re providing the correct current credentials:

Recovery Key Format

Recovery keys use the BIP39 mnemonic standard:
  • 24 words from a standardized word list
  • Each word encodes ~11 bits of entropy
  • Total: 256 bits of entropy (same as the master key)
  • Words are lowercase, space-separated
  • Order matters
Example (do not use this):

Unencrypted Repositories

You can create an unencrypted repository (not recommended):
Unencrypted repositories are not recommended. Your backup data is stored in plaintext and can be read by anyone with storage access.
Use cases for unencrypted repositories:
  • Testing and development
  • Backups of already-encrypted data
  • Air-gapped systems with physical security

Next Steps

First Backup

Create your first encrypted backup

Restoring Files

Use your encryption key to restore backups

Automation

Automate backups with platform keys

Check Command

Verify encrypted data integrity