LockBox is an encrypted file container that allows you to securely store files and directories in a single password-protected file. It provides a virtual filesystem where all contentsβincluding filenames, directory structures, and file dataβare encrypted using the SPHINX cipher.
# Clone the repository
git clone https://github.com/yourusername/LockBox.git
cd LockBox
# Create build directory
mkdir build && cd build
# Configure and build
cmake ..
make -j$(nproc)
# Run tests (optional)
cmake -DBUILD_TESTS=ON ..
make LockBoxTests
./LockBoxTests
Running LockBox without arguments opens the main menu:
./LockBox
+==========================================+
| LOCKBOX - Main Menu |
+==========================================+
[1] Open LockBox
[2] Create LockBox
[3] Encrypt text
[4] Decrypt text
[0] Exit
>>
# Interactive mode - follow the prompts
./LockBox
# Select option [2] Create LockBox
# Or command-line mode
./LockBox /path/to/folder output.lb "yourpassword"
# Interactive mode
./LockBox
# Select option [1] Open LockBox
# Command-line extraction
./LockBox -e archive.lb /destination "yourpassword"
# Create a LockBox from a folder
./LockBox /path/to/folder output.lb "mypassword"
# Extract entire LockBox
./LockBox -e archive.lb /destination "mypassword"
# Encrypt text (outputs hex)
./LockBox -c "secret text" "password"
# Decrypt text (hex input)
./LockBox -d "a1b2c3d4e5f6..." "password"
# Encrypt a file (raw binary output)
./LockBox -cf input.txt output.enc "password"
# Decrypt a file (raw binary output)
./LockBox -df output.enc decrypted.txt "password"
# Show help
./LockBox -h
| Arguments | Description |
|---|---|
<src> <lockbox> <pass> |
Create LockBox from file/folder |
-e <lockbox> <dest> <pass> |
Extract LockBox to destination |
-c <text> <password> |
Encrypt text to hex |
-d <hex> <password> |
Decrypt hex to text |
-cf <input> <output> <pass> |
Encrypt file (raw output) |
-df <input> <output> <pass> |
Decrypt file (raw output) |
-h |
Show help |
Once a LockBox is opened, CLI mode provides a Unix-like shell interface:
lockbox:/$ ls
π documents/
π images/
π config.json (2.4 KB)
Total: 3 items
lockbox:/documents$ cat report.txt
This is the content of my encrypted file...
lockbox:/documents$ cd ..
lockbox:/$ tree
/
βββ π documents/
β βββ π report.txt
β βββ π notes.txt
βββ π images/
β βββ π photo.jpg
βββ π config.json
lockbox:/$ exit
| Command | Syntax | Description |
|---|---|---|
ls |
ls [path] |
List directory contents |
cd |
cd <path> |
Change directory |
pwd |
pwd |
Print working directory |
cat |
cat <file> |
Display file contents |
mkdir |
mkdir <path> |
Create directory |
rm |
rm <path> |
Remove file/directory |
mv |
mv <src> <dst> |
Move or rename |
cp |
cp <src> <dst> |
Copy file/directory |
rename |
rename <path> <newname> |
Rename item |
find |
find <pattern> |
Search by name |
tree |
tree [path] |
Display tree structure |
add |
add <file> [path] |
Import from filesystem |
extract |
extract [src] <dst> |
Export to filesystem |
info |
info <path> |
Show detailed information |
limit |
limit [n] |
Set max items displayed |
clear |
clear |
Clear screen |
help |
help [cmd] |
Show help |
exit |
exit |
Return to menu |
. (current), .. (parent), and absolute / paths"my folder/file.txt"After opening a LockBox, the management menu provides:
| Option | Function |
|---|---|
| Extract | Export all or part of the contents to the filesystem |
| CLI Mode | Access the interactive shell for file operations |
| Search | Search files by name pattern |
| Defragment | Compact the file, reclaiming space from deleted items |
| View Log | Display encrypted operation log |
| Clear Log | Clear the activity log |
| Save & Exit | Save changes and exit |
Over time, deleting files leaves unused space in the container. Defragmentation:
LockBox maintains an encrypted log of operations:
LockBox uses the SPHINX cipher, a modern wide-block encryption algorithm:
Default configuration provides 256-bit security (16 blocks Γ 16-bit words).
β
File contents
β
File names
β
Directory names
β
Directory structure (via encrypted pointers)
β
Timestamps
β
Activity log
The only unencrypted data is the raw container file size (which reveals approximate storage usage).
LockBox consists of three main layers:
βββββββββββββββββββββββββββββββββββββββ
β APPLICATION LAYER β
β (Interactive UI, CLI Parser) β
βββββββββββββββββββββββββββββββββββββββ€
β VIRTUAL FILESYSTEM (iNode) β
β (Tree structure, file operations) β
βββββββββββββββββββββββββββββββββββββββ€
β ENCRYPTION ENGINE (OpenES) β
β (SPHINX cipher, key mgmt) β
βββββββββββββββββββββββββββββββββββββββ€
β PLATFORM ABSTRACTION LAYER β
β (File I/O, memory mapping) β
βββββββββββββββββββββββββββββββββββββββ
For detailed technical documentation, see doc/architecture.md.
history -c # Bash
Clear-History # PowerShell
shred on Linux)βFailed to open LockBoxβ
βOut of memoryβ during defragment
βPermission deniedβ
Slow performance
-O3 optimizations)CMake version too old
# Ubuntu/Debian
sudo apt update && sudo apt install cmake
# macOS
brew install cmake
Compiler doesnβt support C++23
doc/architecture.md for technical detailsdoc/oes.md for SPHINX cipher specification./LockBoxTests (if built with -DBUILD_TESTS=ON)| Threat | Mitigation |
|---|---|
| Unauthorized access | Strong encryption, password required |
| Known-plaintext attacks | Wide-block cipher with full diffusion |
| Side-channel attacks | Constant-time operations, no lookups |
| Memory dumps | Secure zeroing of keys |
| File carving | No predictable headers or magic numbers |
Typical performance on modern hardware:
| Operation | Speed |
|---|---|
| Encryption | ~50-100 MB/s |
| Decryption | ~50-100 MB/s |
| File listing | <100ms for 1000 files |
| Defragment | ~10-20 MB/s |
Actual performance depends on hardware, block size configuration, and data patterns.
Contributions are welcome! Areas for improvement:
See source code documentation in doc/architecture.md.
This project is licensed under the MIT License - see the LICENSE file for details.
Note: This software is provided as-is without warranty. Always maintain backups of important data.