Back to docs
configuration

Encryption

End-to-End Encryption

Strayfiles Pro uses end-to-end encryption for Stray Cloud. Your notes are encrypted before leaving your device - we never see the plaintext.

How It Works

Your Password

Argon2id Key Derivation (64 MiB memory, 4 iterations)

Derived Key (256-bit)

Unlocks Encrypted Key File

Master Key (256-bit)

AES-256-GCM Encryption

Encrypted content synced to Stray Cloud

Key File Location

Your encryption keys are stored locally:

~/.strayfiles/keys.enc

This file contains your master key, encrypted with a key derived from your password. Keep this file safe - it’s required to decrypt your notes.

Security Properties

ComponentImplementation
EncryptionAES-256-GCM (authenticated)
Key DerivationArgon2id
Memory Cost64 MiB
Time Cost4 iterations
Parallelism4 threads
Nonce96-bit random per encryption

Setting Up Encryption

When you first enable Pro sync, you’ll be prompted to create an encryption password:

  1. Choose a strong password (this protects your master key)
  2. Strayfiles generates a random master key
  3. Master key is encrypted with your password
  4. Encrypted key file saved to ~/.strayfiles/keys.enc

Local-Only Files

Mark sensitive files to skip Stray Cloud sync entirely:

---
title: API Keys & Secrets
strayfiles:
  enabled: true
  sync: false
---

Files with sync: false:

  • Stay on your local device only
  • Never uploaded to Stray Cloud
  • Still indexed and searchable locally
  • Still have local version history

Key Rotation

The encryption system tracks usage to prevent cryptographic issues:

  • Each key has a usage counter
  • Limit: 2^32 encryption operations
  • When approaching limit, rotate keys
  • Strayfiles warns you before reaching limit

In practice, you’d need to encrypt billions of notes to hit this limit.

Memory Safety

All cryptographic material uses secure memory handling:

  • Keys zeroed immediately when no longer needed
  • No plaintext keys in swap files
  • Protected against memory forensics

What’s Encrypted

DataEncrypted
Note contentYes
Note titlesYes
File pathsNo (needed for sync logic)
Metadata (timestamps)No
Tags/workspacesPartial

Recovery

If you forget your password:

  • Your encrypted notes cannot be recovered
  • We don’t have your password or master key
  • Local unencrypted files remain accessible

Backup your key file:

  • Copy ~/.strayfiles/keys.enc to a safe location
  • Store your password in a password manager

Disabling Encryption

You can’t disable encryption for existing synced notes. To remove encrypted notes:

  1. Export notes locally
  2. Delete from Stray Cloud
  3. Re-add without Pro sync

Technical Details

Encryption format:

nonce (12 bytes) || ciphertext || auth_tag (16 bytes)

Key file format:

{
  "version": 1,
  "salt": "base64-encoded-salt",
  "params": {
    "memory_cost": 65536,
    "time_cost": 4,
    "parallelism": 4
  },
  "encrypted_master_key": "base64-encoded-ciphertext"
}

Why These Choices?

AES-256-GCM: Industry standard authenticated encryption. Provides both confidentiality and integrity.

Argon2id: Winner of the Password Hashing Competition. Resistant to GPU and ASIC attacks.

64 MiB memory: High memory cost makes brute-force attacks expensive.

Random nonces: Each encryption uses a fresh random nonce - no nonce reuse possible.