
Learn how CryFS protects your data with advanced encryption techniques.
This page explains the technical details of CryFS. If you're looking to get started quickly, check out the CryFS Tutorial instead.
CryFS is designed to encrypt your files for cloud storage while hiding not just the content, but also the structure and metadata of your data.
| Threat Model | What CryFS protects against and its security boundaries |
| Block-Based Storage | How files are split into encrypted blocks to hide metadata |
| Configuration File | Two-layer encryption and key derivation |
| Integrity Protection | Version tree and rollback protection |
| Security Analysis | Academic publications and proven security properties |
Before diving into the technical details, it's important to understand what CryFS protects against and its security boundaries.
CryFS is designed to protect your data when stored on untrusted storage, such as cloud providers. It defends against:
CryFS assumes your local machine is secure. It does not protect against:
--config to remain secure even with a weak password)
Traditional file-based encryption (like EncFS or gocryptfs) creates one encrypted file for each of your files. This reveals information: an attacker can see how many files you have, how large each one is, and how they're organized into directories. This metadata can reveal a surprising amount about what you're storing.
CryFS takes a different approach. Instead of encrypting files individually, it splits all data into fixed-size blocks (typically 32KB). These blocks are then encrypted and stored with random IDs as filenames.
Crucially, all these block types—file content, directory entries, metadata, and tree structure—are encrypted identically and are completely indistinguishable from each other. An attacker cannot tell whether a block contains part of a file, a directory listing, or internal tree structure.
The result: an attacker with access to your cloud storage sees only a collection of identically-sized encrypted blocks with random names. They cannot determine:
Each block is encrypted using an authenticated encryption cipher (default: XChaCha20-Poly1305). This provides:
A unique encryption key is generated when you create a CryFS filesystem. This key is stored in the configuration file, protected by your password.
When you create a CryFS filesystem, it generates a configuration file (typically named cryfs.config) in the base directory. This file contains everything CryFS needs to decrypt your data.
The configuration file includes:
xchacha20-poly1305)The configuration file itself is encrypted with two layers to ensure maximum security:
This dual encryption means:

Both encryption keys are derived from your password using scrypt, a memory-hard key derivation function designed to be resistant to brute-force attacks. The scrypt parameters are stored (unencrypted) at the beginning of the configuration file so CryFS knows how to regenerate the keys.
For maximum security, consider these options:
--config /local/path to store the configuration file outside your cloud storage--cipher xchacha20-poly1305 to explicitly verify the cipher on each mountCryFS provides comprehensive integrity protection beyond just authenticated encryption of individual blocks.
CryFS maintains a version tree that tracks the expected version of each block. This prevents:
Each time a block is modified, its version number is incremented. CryFS stores these version numbers locally on your machine (not in the cloud), which allows it to detect if any block has been rolled back or if the version information itself has been tampered with.
When you mount your filesystem, CryFS verifies that all version numbers match what it expects. If there's a mismatch, the filesystem refuses to mount and alerts you to the tampering.
Integrity protection requires state to be maintained about what versions are expected. This state is stored on your local machine. If you access the filesystem from a new machine, CryFS will need to trust the current state of the cloud storage as a baseline for rollback detection. However, the authenticated encryption scheme still ensures that attackers cannot arbitrarily modify block contents—only rollback protection is affected when accessing from a new device.
The security of CryFS has been formally analyzed and proven using game-based security proofs.
The security analysis proves that CryFS achieves:
Confidentiality:
Integrity:
As far as we know, CryFS is the only cloud filesystem encryption tool with published, peer-reviewed security proofs. Other tools may be secure, but their security properties have not been formally analyzed and documented.
Ready to get started?