Skip to content

Repository files navigation

Secure File Locker (C++)

A command-line tool to encrypt/decrypt files using AES-256-GCM with PBKDF2-HMAC-SHA256 key derivation, plus metadata, verify, list, and secure delete.

Features

  • AES-256-GCM authenticated encryption
  • PBKDF2-HMAC-SHA256 (configurable iterations)
  • Per-file random salt (16B) and IV/nonce (12B)
  • Embedded metadata: original filename, size, plaintext SHA-256
  • Streaming I/O for large files
  • Best-effort secure delete (overwrite, fsync, unlink)
  • Simple CLI: encrypt, decrypt, verify, list, delete-secure

Build (macOS via Homebrew, Linux similar)

# prerequisites
xcode-select --install || true
brew install cmake openssl@3

# configure & build
OPENSSL_PREFIX="$(brew --prefix openssl@3)"
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release   -DOPENSSL_ROOT_DIR="$OPENSSL_PREFIX"   -DOPENSSL_INCLUDE_DIR="$OPENSSL_PREFIX/include"   -DOPENSSL_CRYPTO_LIBRARY="$OPENSSL_PREFIX/lib/libcrypto.dylib"
cmake --build build --config Release

Usage

./build/sflk --help
./build/sflk encrypt <file> [--iter N] [--out file.sflk]
./build/sflk decrypt <file.sflk> [--out restored_name]
./build/sflk verify  <file.sflk>
./build/sflk list    <file.sflk>
./build/sflk delete-secure <file>

About

Secure File Locker is a command-line tool written in modern C++17 that lets you safely encrypt, decrypt, verify, and manage files with password-based protection. It uses industry-standard cryptography (AES-256-GCM and PBKDF2-HMAC-SHA256) and embeds metadata for file integrity checks.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages