Vault is a lightweight, interactive command-line application written in C that manages and encrypts files directly on your operating system's filesystem.
It groups files into encrypted directories called vaults. You can easily lock or unlock entire vaults with a master password, keeping your files secure through an integrated XOR-based cipher while treating the filesystem as the authoritative source of truth.
- Vault Management: Create, open, merge, and delete vaults.
- Batch Lock/Unlock: Lock or unlock all files inside a vault in a single operation.
- File Management: Move existing files into a vault, create new ones, or delete them safely.
- Basic Encryption: Built-in XOR stream cipher encryption directly derived from your vault password.
- Secure File System Syncing: Metadata mirrors the real-time filesystem state, avoiding "ghost" files.
- Pure C Implementation: Zero external dependencies, leveraging standard C libraries.
This project requires gcc (GNU Compiler Collection).
You can compile the program manually using gcc:
mkdir -p bin
gcc -Wall -Wextra -I include src/main.c src/vault_system.c src/vault.c src/reader.c src/crypto.c src/fs.c -o bin/vaultLaunch the interactive CLI by running the executable:
# Windows
bin\vault.exe
# Linux / macOS
./bin/vaultFrom the main menu, you can:
- List vaults: View all currently available vaults.
- Create vault: Setup a new vault directory and assign a master password.
- Open vault: Enter a vault using your password to manage its files.
- Merge vaults: Move all unlocked files from one vault into another.
- Delete vault: Permanently delete a vault and all its files (requires password confirmation).
Once a vault is opened, you can manage the internal files:
- Lock/Unlock vault: Encrypts or decrypts every file in the vault, appending/removing the
.lockedextension. - Add existing file: Safely move a file from outside the vault into the encrypted directory.
- Create new file: Quickly generate an empty file directly inside the vault.
The project includes an isolated unit testing suite for the core vault data structures.
To run the tests:
gcc -Wall -Wextra -I include src/test_vault.c src/vault.c -o bin/test_vault
./bin/test_vault- Vaults are stored locally as subdirectories inside a
Vaults_folder/directory. - Global metadata is saved to
data/vault.dat. The filesystem always acts as the ultimate source of truth.
- Fully Atomic States: A vault is either entirely locked or entirely unlocked. Partial or mixed states will reject subsequent lock/unlock requests.
- In-place Transformation: The XOR cipher transforms the binary content of the files in-place and renames them to explicitly indicate their
.lockedstatus. - Note: The XOR encryption is designed as a lightweight deterrent and structural exercise, not for military-grade cryptographic security.
- Basic Cryptography: Uses a repeating-key XOR cipher. It does not utilize AES, PBKDF2 hashing, or CSPRNG, making it unsuitable for highly sensitive information.
- Non-transactional: File operations are applied sequentially. In the rare event of a sudden power loss during a lock/unlock sequence, manual recovery may be necessary.
- Single-User Environment: Concurrency/multithreading locks are not implemented.
This project is open-source and free to use. Designed as an entry-level systems architecture project in C.