Skip to content

Nevio-Source/Passgen_cli

Repository files navigation

PassGen 🔐

                                .                   ,;L.            
t                              ;W       ;W        .Gt       f#i EW:        ,ft
ED.                 ..        f#E      f#E       j#W:     .E#t  E##;       t#E
E#K:               ;W,      .E#f     .E#f      ;K#f      i#W,   E###t      t#E
E##W;             j##,     iWW;     iWW;     .G#D.      L#D.    E#fE#f     t#E
E# ##t           G###,    L##Lffi  L##Lffi  j#K;      :K#Wfff;  E#t D#G    t#E
E#  ##f        :E####,   tLLG##L  tLLG##L ,K#f   ,GD; i##WLLLLt E#t  f#E.  t#E
E#t ;##D.     ;W# G##,     ,W#i     ,W#i   j#Wi   E#t  .E#L     E#t   t#K: t#E
E#ELLE##K:   j#/  W##,    j#E.     j#E.     .G#D: E#t    f#E:   E#t    ;#W,t#E
E#L;;;;;;,  G##iHHG##,  .D#j     .D#j         ,K#fK#t     ,WW;  E#t     :K#D#E
E#t       :K#K:   L##, ,WK,     ,WK,            j###t      .D#; E#t      .E##E
E#t      ;##D.    L##, EG.      EG.              .G#t        tt ..         G#E
         ,,,      .,,  ,        ,                  ;;                       fE

Created By: @Nevio-Source

A secure CLI‑based password generator with support for customizable length, Unicode options, and breach checking.

Table of Contents

Overview

More detailed description of the project.

Motivation: I created PassGen to ensure strong, unpredictable passwords. All planned features aim to maximize security and usability.

Goals:

  1. Generate purely random passwords.
  2. Avoid known passwords via HIBP checks.
  3. Provide flexible Unicode support.

Features

  • Choosing Password length
  • Choos whether or not using special Unicode characters for the password
  • Checking with HIBP if the password is known

Planned Features

  • Store the password in a local database

Architecture

The application is a single-file, console-based password generator with a modular functional architecture. While implemented in one class, the program is conceptually split into clearly separated responsibilities.

High-Level Overview

The program consists of four main conceptual layers:

  1. User Interface (Console I/O)
  2. Entropy & Password Generation
  3. Network & External Validation
  4. Utility & Cryptographic Functions

These layers interact linearly and do not share mutable global state.


1. User Interface Layer

Responsible for all user interaction via the console.

Includes:

  • ASCII banner rendering
  • User input handling (password length, unicode selection)
  • Output formatting (password display, warnings, status messages)
  • Program loop and control flow

This layer does not perform any cryptographic or network logic directly.


2. Entropy & Password Generation Layer

Responsible for generating cryptographically strong randomness and transforming it into a user-readable password.

Key concepts:

  • Multiple entropy sources (time-based data + system RNG)
  • SHA-256 hashing and HMAC combination
  • Deterministic expansion of entropy to arbitrary password lengths
  • Mapping raw entropy bytes to a configurable character lexicon

The generator is designed to:

  • Avoid predictable patterns
  • Scale up to large password sizes
  • Remain independent of user input quality

3. Network & External Validation Layer

Responsible for optional online validation of generated passwords.

Includes:

  • Network availability check via ICMP (Ping)
  • Integration with the Have I Been Pwned (HIBP) API
  • k-Anonymity model (SHA-1 prefix querying)

Design goals:

  • No plaintext password is ever transmitted
  • Graceful degradation when offline
  • Non-blocking behavior via async calls

This layer is optional and does not affect password generation itself.


4. Utility & Cryptographic Functions

Low-level helpers used by higher layers.

Includes:

  • Cryptographic hash functions (SHA-1, SHA-256, HMAC)
  • Secure random number generation
  • Time-based entropy helpers
  • Formatting and conversion utilities

These functions are stateless and reusable.


Design Characteristics

  • Single-process, single-threaded execution model
  • Stateless password generation (no persistence)
  • Defensive error handling with fallbacks
  • Clear separation between generation and validation
  • Console-first, platform-agnostic design

This architecture favors clarity, security, and predictability over abstraction or framework complexity.

Requirements

What is required to build or run the project?

  • You need Linux or Windows

Installation

Windows

  1. Download the Passgen_windows.exe file from the latest release.
  2. Start the program by clicking the exe. Or Open Powershell navigate to the folder with the exe and execute
start Passgen_windows.exe

Linux

Binary

  1. Download the Passgen_linux from the latest releases
  2. Open your terminal and navigate to the folder with the binary then insert the following command
sudo chmod +x Passgen_linux
  1. Now you can execute it with
./Passgen_linux

Deb

  1. Download passgen_x.x.x_amd64.deb from the latest release
  2. Install it with
sudo apt install ./passgen_x.x.x_amd64.deb
  1. Now you can execute the program by typing passgen in your terminal

Flags

Defining Length 0-1000

-l <length>

Toggle Unicode

-u 

Skipp HIBP

--no-check 

Show help

--help