• v2.5.0 7cf174e4a3

    v2.5.0 Stable

    sezieru released this 2025-10-17 20:42:46 +00:00 | 33 commits to main since this release

    RexCrypt v2.5.0

    Highlights

    • Salt specification (-s <salt>): Pass a deterministic salt/setting to get a resulting hash. The same salt/setting, key, and algorithm will generate the same resulting hash.
    • Verify mode (-V <hash>): Pass the stored hash as the "setting" to crypt(3) and compare. Prints human-readable status and provides exit codes for scripting/TAP tests.
    • List algorithms (-L): Probe support on the current system (via crypt_gensalt()), and where available, crypt_checksalt()) and prints a short status table. Perfect for "what does this box support?" demos.
    • TAP v14 tests expanded: Test runner asserts exit codes, treats rexcrypt as a black box, and prints TAP to stdout with diagnostics on stderr. Added cases around verify OK/FAIL and error paths; regex comparator prints helpful compile errors.
    • Usage/README/TESTING updated: Built-in help and docs provide information on feature options, and docs provide additional detail where needed.

    Changes & Refactors

    • Complete refactor of the core: rexcrypt.c has been rewritten to move much of the functionality into separate functions, adding new functions for support, and providing appropriate documentation in all cases.
    • select_alg() no longer allocates: now returns a const char * "setting" prefix; callers stop freeing it. Simpler, safer, and easier to explain.
    • Unsigned count semantics: Internal counters (e.g. resalt, cpu_tim, and alg) use unsigned long; parsing moved to strtoul() (parse_ulong() helper). The resalt loop was adjusted to avoid the classic "--u >= 0" unsigned underflow trap; comments call this out as a teachable gotcha.
    • Additional polish: Safer copymem() demo, consistent help/usage text, and alignment/comment cleanups.
    • Multi-line support for regex comparator: cmp_regex.c now supports multi-line matches, allowing for greater test case flexibility & robustness.

    CLI (recap)

    rexcrypt [-c <cpu_tim>] [-r <resalt>] [-a <alg>] [-k <key>|-] [-s <salt>] [-V <hash>] [-L]
    
    • -k - reads from stdin (newline trimmed; echo not disabled).
    • Passphrase input is capped by CRYPT_MAX_PASSPHRASE_SIZE (commonly 512 bytes).

    Build / Test

    make            # builds ./bin/rexcrypt
    make test       # runs TAP v14 tests
    

    Notes

    • RexCrypt remains an educational tool, not a production password subsystem.
    • Algorithm availability and the semantics of -c depend on your system's libxcrypt build.
    Downloads