Skip to content

abhi-saurav-saroya/CipherSafe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CipherSafe - Secure File Locker

Because your secrets deserve CipherSafe.


CipherSafe is a console-based secure file vault application built in C++, designed to simulate how encrypted file storage systems work internally.
The project focuses on core backend concepts such as authentication, encryption, file system design, metadata management, and clean architecture — without relying on any GUI frameworks.

Note: This project is built for learning and demonstration purposes. Encryption used is XOR-based and not intended for production security.

C++

SHA256 XOR Cryptography

nlohmann/json

License

Features

  1. Authentication System

    • Master user sign-up & sign-in
    • Secure password hashing with salt
    • Persistent user storage (JSON-based)
    • Session-based login tracking
  2. Vault Management

    • Import & encrypt files into a secure vault
    • Per-file metadata management
    • Unique ID-based file tracking
    • Automatic directory creation per file
  3. File Lifecycle

    • Soft delete (move to temp/)
    • Recover deleted files
    • Permanent purge (irreversible)
    • Encrypted files stored at rest
  4. Encryption

    • XOR-based encryption & decryption
    • Binary-safe (works for text, images, etc.)
    • Key derived from logged-in master user

Project Architecture

Project Dir

Data Directory Structure

Data Dir

Tech Stack

Component Technology
Language C++ (C++20)
Build Tool g++ (MinGW on Windows)
Storage File System + JSON
Encryption XOR-based (custom)
Libraries STL, <filesystem>, nlohmann/json

Libraries Used

  1. STL (Standard Template Library)

    • std::vector
    • std::string
    • std::filesystem
    • std::fstream
    • std::ctime
  2. nlohmann/json

    • Used for persistent storage of:
      • User credentials
      • Vault index
      • File metadata
  3. Header-only JSON library.

Acknowledgements

  • nlohmann/json — Header-only JSON library for C++
    Created by Niels Lohmann
    Used for structured and persistent data storage (auth.json, vault index, metadata).
    GitHub: https://github.com/nlohmann/json

Data Structures Used

Structure Purpose
vector<VaultFile> Tracks all vault files
struct VaultFile Stores file metadata
enum class FileLocation Objects vs Temp
JSON Arrays Persistent indexing

System Design Overview

  1. AuthManager

    • Handles master users
    • Password hashing & verification
    • Login session tracking
    • Persistent storage in auth.json
  2. VaultManager

    • Manages encrypted files
    • Handles file lifecycle
    • Maintains vault_index.json
    • No UI responsibility (logic-only)
  3. UI Layer

    • AuthUI → Authentication menu
    • DashboardUI → Vault operations
    • Input validation & flow control

Application Workflow

  1. Application Start

    • Load existing master users
    • Display authentication menu
  2. Authentication Phase

    • User signs up OR signs in
    • Password is verified via hashing
    • Session is established
  3. Dashboard Phase

    User can:

    • Import & encrypt files
    • List stored files
    • Decrypt files
    • Soft delete / recover
  4. Logout

    • Session cleared
    • Vault state saved
    • Return to auth menu

Encryption Design (XOR)

How it works:

  • File bytes are XOR-ed with a repeating key
  • Same function used for encryption & decryption
  • Binary-safe implementation

Build & Run Instructions

Requirements

  • g++ (C++17 or later)
  • MinGW (Windows) or GCC (Linux)

Compile

g++ src/main/*.cpp src/ui/*.cpp src/utils/*.cpp src/managers/*.cpp -Iinclude/utils/ -Iinclude/ui/ -Iinclude/libs/ -Iinclude/managers/ -o CipherSafe

Run (cmd)

CipherSafe.exe

Run (powershell)

.\CipherSafe

Footer

Built for fun, engineered for learning, encrypted for practice. 💾 Because your secrets deserve CipherSafe. 🛡️


© 2026 Open Source Project | CipherSafe - Secure File Locker | MIT License

About

CipherSafe is a lightweight C++ file vault that lets users securely encrypt, store, recover, and manage files through a clean console dashboard.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages