secure-passgenv3.0.2 manual page — generated 2026-09-04 09:30:58
Rust logo

secure-passgen

Military-grade, fool-proof, international password generator & CSV database creator
Rust Version Tests Speed Valgrind i18n Charsets Security License Platform
25/25
Tests Passed
12241316.49
Max pw / second
~2703 KB
Avg Memory
9.29 ms
Hyperfine Mean (10K)

§1NAME

secure-passgen — military-grade, fool-proof, international (i18n) password generator and LibreOffice/Excel-compatible CSV database creator, written in Rust with a plugin architecture and Deep-Entropy (SHA-512 hash-chaining) engine.

§2SYNOPSIS

secure-passgen [OPTIONS] [COUNT] [-COUNT_SHORTHAND]

secure-passgen -c -n -s -l 16 -1M -o database.csv
secure-passgen --password-db --charset chinese -c -n -2500 -o grid.csv
secure-passgen --language hu --charset hu -c -n -s --extreme-random -l 20
secure-passgen --plugins uppercase,hyphen -c -n -100K -o bulk.csv

§3DESCRIPTION

secure-passgen generates cryptographically secure passwords using the operating system's CSPRNG (getrandom: Linux getrandom(2) syscall, macOS getentropy(2), Windows BCryptGenRandom). It re-implements and extends the classic pwgen(1) tool with modern safety guarantees:

🛡️ Fool-proof design

The program never aborts on user errors. Every problem (existing file, unwritable directory, invalid number, empty charset) is automatically corrected and reported in a final "AUTOMATIC FIXES APPLIED" panel.

🌍 International (i18n)

20 UI languages for all console messages and 20 Unicode character sets (Latin, Magyar, 中文, 日本語, 한국어, العربية, עברית, हिन्दी, বাংলা, ไทย, Ελληνικά, Кириллица, Հայերեն, ქართული, தமிழ், తెలుగు, ಕನ್ನಡ, മലയാളം, ਪੰਜਾਬੀ, සිංහල).

🧠 Deep Entropy engine

Optional SHA-512 hash-chaining mode: each password seed is re-hashed up to 1,000,000 iterations so every character derives from the "millionth" cryptographic operation, not the first.

💾 Streaming memory model

Passwords are generated one-by-one and streamed through an 8 KB BufWriter. Memory stays at ~2.7 MB whether you generate 10 or 1,000,000 passwords. Verified by Valgrind: 0 bytes lost.

🔌 Plugin architecture

Trait-based plugin system (Plugin trait). Two reference plugins ship with the binary: uppercase and hyphen. New plugins require ~20 lines of Rust.

📊 Database Grid mode

--password-db produces a spreadsheet grid with Excel-style column headers (Row,A,B,...,ZZ,AAA...) up to 1000 rows, directly importable into LibreOffice Calc / Excel.

§4OPTIONS

4.1 Password style (pwgen-compatible)

OptionDescription
-c, --capitalsInclude capital letters (A-Z, and uppercase variants of the selected script).
-n, --numbersInclude digits 0-9.
-s, --symbolsInclude symbols !@#$%^&*()-_=+[]{}|;:,.<>?
-B, --no-ambiguousExclude visually ambiguous characters 1 l I 0 O o.

4.2 Generation

OptionDescriptionDefault
-l, --length <N>Password length, 1–16000 (OpenSSL-class maximum).8
--count <N>Number of passwords.10
-5, -250, -100K, -1MHyphen shorthand count (pre-processed before the CLI parser, so it can never swallow other flags).—
--extreme-randomEnable Deep Entropy SHA-512 hash-chaining per password.off
--extreme-iter <N>Hash iterations per password, 1000–1000000.10000

4.3 Output & database

OptionDescription
-o, --output <file>Output CSV path (relative or absolute).
--password-dbDatabase Grid mode with Excel column letters.
--auto-renameIf the target file exists, write name_1.csv, name_2.csv… (default ON).
--timestampAppend YYYYMMDD_HHMMSS to the filename instead of a counter.
--log <file>Metadata log (time, system, fixes). Never logs passwords.

4.4 International & system

OptionDescription
--language <code>UI language: en hu es zh hi ar bn pt ru ja de fr ko tr vi it pl uk nl ro (or auto).
--charset <code>Password character set: latin hu zh ja ko ar he hi bn th el ru hy ka ta te kn ml pa si.
--plugins <list>Comma-separated plugin list: uppercase, hyphen.
--debugVerbose internal diagnostics on stderr.
-h, --help / -V, --versionHelp / version.

§5CHARACTER SETS (live samples)

The samples below were generated by this binary at documentation build time (12 characters each):

FlagLive generated sample
--charset latindolxlccvxjjr
--charset hungariancahoékpűayei
--charset chinese们学们也种说能的生是子能
--charset japaneseオほニすエエノサヌれアウ
--charset korean버투터사주라오버서수사터
--charset arabicضجفشفكخصزثظظ
--charset hebrewלהקפסאגרקדזפ
--charset hindiउथटओढउअनगनपऔ
--charset bengaliঘধসঐগদতওউতদঠ
--charset thaiฒซกนลฟพมทญอญ
--charset greekεκπταοχσβαοχ
--charset cyrillicбеёужжвъищбй
--charset armenianնգխնժէնղվնխճ
--charset georgianძლთშოყღჩჩბძბ
--charset tamilஞனஞஉரடசவஒவவவ
--charset teluguషనకఇడఔగసఞణమజ
--charset kannadaರಙಧಏಕನಛಋಈಐಜಯ
--charset malayalamഭജശഋടഎലഷഎആഷഈ
--charset gurmukhiਚਪਭਹਯਅਥਦਅਹਓਠ
--charset sinhalaදවඪඡණලකඳඵඌඬඌ

§6UI LANGUAGES

All console banners, progress labels, success messages and the auto-recovery panel are translated. Detected automatically from $LANG, overridable with --language. Supported: English, Magyar, Español, 中文, हिन्दी, العربية, বাংলা, Português, Русский, 日本語, Deutsch, Français, 한국어, Türkçe, Tiếng Việt, Italiano, Polski, Українська, Nederlands, Română.

§7DEEP ENTROPY ENGINE

1. seed = 64 bytes from OS CSPRNG (getrandom syscall)
2. for i in 0..iterations:            # up to 1,000,000
       seed = SHA512(seed || i.to_le_bytes())
3. for each character position p:
       index = u16(seed[2p], seed[2p+1]) mod charset_len
       password[p] = charset[index]
Why? Standard CSPRNG output is already secure, but in threat models where the first milliseconds after boot are suspect (entropy-pool warm-up), Deep Entropy guarantees that every emitted character is the result of the millionth mixing operation, not the first. Throughput cost is linear and measured in the benchmark table below.

§8MEMORY ARCHITECTURE

§9PLUGIN SYSTEM (developer guide)

// src/plugins/my_plugin.rs  (~20 lines)
use super::Plugin;

pub struct MyPlugin;

impl Plugin for MyPlugin {
    fn name(&self) -> &str { "MyPlugin" }
    fn description(&self) -> &str { "Does something custom" }
    fn process_password(&self, password: String) -> String {
        password.to_uppercase()   // any transformation
    }
}

Register it in src/plugins/mod.rs and in load_plugins() in main.rs, then use --plugins myplugin. Future roadmap: dynamic .so loading via libloading and WASM plugins.

§10AUTO-RECOVERY (fool-proof engine)

Problem detectedAutomatic solutionSeverity
Output file already existsWrites name_1.csv … name_9999.csv, then timestamp name⚠ Warning
Directory not writableFalls back to /tmp, then $HOME; real path printed⚠ Critical
Empty character setRestores the full base charset of the selected script⚠ Critical
Length < 1 or > 16000Clamped to 8 / 16000⚠ Warning
Count < 1Reset to 10⚠ Warning
Unknown --language / --charsetFalls back to system language / Latin⚠ Warning

Every applied fix is listed in the final yellow panel, so soldiers and beginners always see what happened and where the file really is.

§11BENCHMARKS (measured on this host)

Values injected from the latest benchmarks_*/results.csv run on this machine:

TestResult
Maximum throughput (100K passwords, 16 chars)12,241,316 pw/s
Hyperfine mean ± σ (10K passwords, 10 runs)9.3 ms ± 1.2 ms
Memory (10 → 100K passwords)2.6–2.8 MB constant
Valgrind leak check0 bytes lost (544 B still-reachable = Rust runtime)
Deep Entropy 1K / 10K / 100K iter8,210 / 2,143 / 138 pw/s
Unicode charsets (6 scripts)all OK, ~11–12K pw/s
Test suite25/25 passed

§12EXAMPLES

boldwelder@parrot:~$
./secure-passgen -c -n -s -l 16 -1M -o million.csv
  [########################################] 100% (1000000/1000000)
  SUCCESS - Operation completed successfully 0.082 seconds
  File saved to /home/boldwelder/secure-passgen/million.csv
database grid, chinese charset
./secure-passgen --password-db --charset chinese -c -n -2500 -o grid.csv
  Mode: Password Database Grid | Columns: A B C | Rows: 1000
  SUCCESS  # open with: libreoffice --calc grid.csv
fool-proof auto-rename
./secure-passgen -c -n -s -o same.csv   # run twice
  ⚠ AUTOMATIC RECOVERY ACTIVATED — Problems found: 1
  ║  Fix #1  Problem:  File 'same.csv' already exists
  ║           Solution: Auto-renamed to 'same_1.csv'

§13BEGINNER GUIDE

  1. Build once: cargo build --release
  2. Generate your first safe passwords: ./target/release/secure-passgen -c -n -s -l 16 -50 -o my.csv
  3. Double-click my.csv → opens in LibreOffice Calc / Excel.
  4. If anything goes wrong, read the yellow panel at the end — it tells you exactly what the program fixed and where your file is.

§14ADVANCED GUIDE

§15SECURITY NOTES

Warning: CSV files contain plaintext passwords. Store them encrypted (e.g. LUKS volume or age/gpg), delete securely (shred), and never commit them to Git.

§16FILES

~/.cargo/bin or ./target/release/secure-passgen   binary
./passwords.csv                                   default output
./benchmarks_*/results.csv                        QA results
./documentation_v2/README.html                    this manual

§17SEE ALSO

pwgen(1), openssl-rand(1), getrandom(2), apg(1), makepasswd(1), NIST SP 800-90A (DRBG), RFC 4180 (CSV).

§18AUTHORS

Boldwelder (micro-electric technician, welder, ex-diplomat MFA, 4-generation Hungarian military family) — concept, requirements, QA. Adjutans-1 — Rust architecture & implementation.

§19CHANGELOG

VersionChange
3.0.2FIXED: hyphen shorthand no longer swallows following flags; FIXED: case-less Unicode scripts (CJK/Arabic/Hindi…) now included by default; docs v2.
3.0.1Removed unused import; warning-free build.
3.0.0Fool-proof auto-recovery, 20 UI languages, 20 Unicode charsets, plugin system.
2.0.0Rust rewrite: CSPRNG, Deep Entropy, streaming CSV, grid mode.
1.xOriginal bash prototype (pwgen-compatible).