Skip to content

About

A secure, cloud-ready CLI password manager built in C++ with zero-knowledge encryption and optional cloud sync.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Cryptenium

A zero-knowledge, encrypted CLI password manager written in C++17.

C++17 libsodium CMake License: MIT Platform

Your credentials, encrypted at rest. Nothing is ever written in plaintext.


Table of Contents


Highlights

  • πŸ›‘οΈ Zero-knowledge by design β€” the vault file is a binary blob; no master password or credential plaintext ever touches disk.
  • πŸ”‘ Envelope encryption β€” your master password derives a Key Encryption Key (KEK) that wraps a random Data Encryption Key (DEK); the DEK encrypts every entry.
  • ⚑ Argon2id KDF β€” memory-hard password hashing (64 MiB / 3 iterations) via libsodium, GPU/ASIC-resistant.
  • πŸ”’ XChaCha20-Poly1305 AEAD β€” authenticated encryption per entry with 192-bit nonces; tamper-evident.
  • 🧠 Secure memory β€” secrets live in sodium_malloc guarded pages, locked, and zeroed on release (RAII).
  • 🎲 CSPRNG generation β€” unbiased secure random passwords with rejection sampling.
  • πŸ“‹ Clipboard hygiene β€” retrieved passwords auto-clear from the clipboard after 15 seconds.
  • πŸ–₯️ Cross-platform β€” Windows, Linux, and macOS.

Security Model

Cryptenium uses a defense-in-depth approach centered on client-side encryption:

        Master Password
              β”‚
              β–Ό
    Argon2id (crypto_pwhash)          ← memory-hard, slow to brute-force
              β”‚
              β–Ό
    Key Encryption Key (KEK) ──────┐   ← held only in secure memory
                                   β”‚   wraps
                                   β–Ό
    Data Encryption Key (DEK)      β”‚   ← random 256-bit, generated at init
              β”‚                    β”‚
              β–Ό                    β”‚
    Per-Entry Keys (BLAKE2b)       β”‚   ← unique key per entry from the DEK
              β”‚                    β”‚
              β–Ό                    β–Ό
    XChaCha20-Poly1305 per entry   β”‚   ← AEAD: ciphertext + MAC + nonce
                                   β”‚
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚  vault.dat: header (KDF params Β· salt Β· 8-byte verifier  β”‚
   β”‚             Β· wrapped DEK Β· entry count) + AEAD blobs    β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Nothing recoverable from disk β€” without the master password, the vault yields only KDF parameters, a random salt, a wrapped DEK, and ciphertext.
  • Master password verification β€” an 8-byte BLAKE2b fingerprint of the KEK is stored and compared in constant time (sodium_memcmp); it leaks nothing about the password (preimage-resistant).
  • Per-entry keys β€” a single compromised entry key does not compromise the rest of the vault.

How It Works

  1. init derives a KEK from your master password with Argon2id and generates a random DEK.
  2. The DEK is wrapped (encrypted) under the KEK; only the wrapped DEK is stored.
  3. Each entry is encrypted under its own key derived from the DEK via BLAKE2b.
  4. On unlock, the client re-derives the KEK, verifies the fingerprint, unwraps the DEK, and decrypts entries β€” all in memory.

Because the KEK exists only for the duration of a session, changing the master password later only requires re-wrapping the DEK β€” the entire vault never needs re-encryption.


Features

Command Description
init Create a new encrypted vault and set your master password
add Store a credential (provided or auto-generated)
get Retrieve a credential; password is copied to the clipboard and cleared after 15 s
list List all stored entries (service / username only β€” never passwords)
delete Remove a credential (with confirmation prompt)
generate Generate a secure random password with configurable character sets
version / help Print version or usage information

Installation

Prerequisites

  • A C++17 compiler (GCC 8+, Clang, MSVC)
  • CMake β‰₯ 3.10
  • libsodium β‰₯ 1.0.18
OS Install libsodium
MSYS2 (UCRT64) pacman -S mingw-w64-ucrt-x86_64-libsodium
Debian / Ubuntu sudo apt install libsodium-dev
macOS brew install libsodium
Windows (vcpkg) vcpkg install libsodium

Build

git clone https://github.com/<you>/cryptenium.git
cd cryptenium
mkdir build && cd build
cmake .. -G "MinGW Makefiles"     # or your platform's generator (e.g. "Unix Makefiles")
cmake --build .

The binary is produced at build/cryptenium (or build\cryptenium.exe on Windows).


Usage

All commands that access the vault prompt for your master password.

# Initialize your vault (sets your master password)
cryptenium init

# Store a credential
cryptenium add --service github --username alice --password secret123

# ...or generate one and store it
cryptenium add --service gmail --username bob --generate --length 20 --symbols

# List all entries
cryptenium list

# Retrieve a credential (password copied to clipboard, cleared after 15 s)
cryptenium get --service github

# Generate a standalone password
cryptenium generate --length 24 --symbols

Command Reference

cryptenium init
cryptenium add --service <s> --username <u> [--password <p> | --generate [--length <n>] [--symbols]]
cryptenium get --service <s> [--username <u>]
cryptenium list
cryptenium delete --service <s> [--username <u>]
cryptenium generate [--length <n>] [--no-digits] [--no-lower] [--no-upper] [--symbols]
cryptenium version
cryptenium help

Note: For interactive use the master password is read with echo disabled. When piping stdin (e.g. in scripts), trailing whitespace is trimmed so piped input behaves consistently.

Vault Location

  • Windows: %USERPROFILE%\.cryptenium\vault.dat
  • Linux / macOS: ~/.cryptenium/vault.dat

Testing

An automated end-to-end suite runs 10 scenarios against an isolated test home (USERPROFILE/HOME), so your real vault is never touched:

cd tests
run_tests.cmd        # Windows / cmd

The suite verifies: init, duplicate-init, add, generated-password add, list contents, wrong-password rejection, confirmed delete, cancelled delete, generation, and version output.


Project Structure

cryptenium/
β”œβ”€β”€ include/
β”‚   β”œβ”€β”€ cli.hpp                  # CLI command parsing & dispatch
β”‚   β”œβ”€β”€ vault.hpp                # Vault storage interface (binary, encrypted)
β”‚   β”œβ”€β”€ password_generator.hpp   # CSPRNG password generation
β”‚   └── platform.hpp             # Hidden input & clipboard helpers
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main.cpp                 # Entry point
β”‚   β”œβ”€β”€ cli.cpp                  # Command implementations
β”‚   β”œβ”€β”€ vault.cpp                # Encrypted binary vault read/write
β”‚   β”œβ”€β”€ password_generator.cpp   # Secure password generation
β”‚   β”œβ”€β”€ platform.cpp             # OS-specific helpers
β”‚   └── crypto/
β”‚       β”œβ”€β”€ Crypto.h             # Crypto module declarations
β”‚       └── Crypto.cpp           # Argon2id, AEAD, secure random, secure memory
β”œβ”€β”€ tests/
β”‚   └── run_tests.cmd            # End-to-end test suite
β”œβ”€β”€ CMakeLists.txt               # CMake build configuration
β”œβ”€β”€ LICENSE
└── README.md

Roadmap

  • Phase 1 β€” Secure Core: encrypted vault, master password, init / add / get / list / delete / generate
  • Phase 2 β€” Envelope encryption: Argon2id KEK, wrapped DEK, per-entry keys, constant-time verification
  • rekey (change master password β€” instant via DEK re-wrap)
  • status / backup / export / import
  • Recovery codes (BIP39-style)
  • Progressive delay + lockdown on failed unlocks
  • Vault tamper detection (canary values, Merkle root, signatures)
  • Optional zero-knowledge cloud sync

Security Considerations

Cryptenium makes the following trade-offs you should understand:

  • Irrecoverable master password β€” by design, losing your master password means losing access to your vault. Back up the vault file and keep your master password safe.
  • Local threat model β€” protection focuses on data at rest and in memory. A compromised OS with active monitoring is outside the threat model.
  • Audited primitives β€” all cryptography is provided by libsodium, a widely audited, battle-tested library. Cryptenium never implements crypto primitives itself.
  • Constant-time operations β€” verifier comparison uses sodium_memcmp; generation uses rejection sampling to avoid modulo bias.

Contributing

Contributions are welcome! Please:

  1. Fork the repository and create a feature branch.
  2. Keep commits small and focused with clear messages.
  3. Run the test suite before opening a pull request.
  4. Discuss security-sensitive changes before implementing them.

License

Distributed under the MIT License. Copyright (c) 2026 Cryptenium.

About

A secure, cloud-ready CLI password manager built in C++ with zero-knowledge encryption and optional cloud sync.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages