• v2.6.0 5e48cacf47

    v2.6.0 Stable

    sezieru released this 2025-10-19 10:33:03 +00:00 | 15 commits to main since this release

    RexCrypt v2.6.0 — now a two-tool teaching suite

    This release adds rexcrack, a small multithreaded dictionary-attack demo that builds directly on RexCrypt’s “hash-as-setting” verification model. No breaking changes to rexcrypt.

    What’s new

    New tool: rexcrack

    • Purpose: educational dictionary attack using crypt_r(3).
    • Concurrency: pthread worker pool; one struct crypt_data per thread; shared fgets() under a mutex; overlong line drain so the next candidate is clean.
    • Validation: anchored regex checks for crypt(5) formats; prefers crypt_checksalt() when available. Legacy DES/bigcrypt intentionally accepted for teaching.
    • I/O discipline: winner printed to stdout; verbose logs (if -v) go to stderr.
    • Exit codes: 0 (match), 2 (not found), EX_* for errors (e.g., EX_NOINPUT bad file, EX_DATAERR invalid hash).

    CLI

    rexcrack -h <hash> -w <wordlist> [-t <threads>] [-v]
    
    • -h <hash>: stored hash (exact string from rexcrypt)
    • -w <wordlist>: newline-separated candidates (blank & overlong lines OK)
    • -t <threads>: default=#CPUs, min 1, soft cap 64
    • -v: verbose tracing to stderr (stdout kept clean for pipelines)

    🔧 RexCrypt improvements (recap)

    • Non-TTY handling + -k - stdin path, length cap via CRYPT_MAX_PASSPHRASE_SIZE.
    • Verify mode (-V <hash>) with script-friendly exit codes (0/2/1).
    • Algorithm probe (-L) to list support on the host.

    🧪 Tests (TAP v14)

    • New cases for rexcrack: match, not-found, bad wordlist, invalid hash, overlong/blank line handling, stdout/stderr separation, thread-count edges.
    • Existing rexcrypt coverage retained (prefixes, stdin/non-TTY, verify OK/FAIL, listing, etc.).

    📚 Docs & build

    • README/TESTING updated with rexcrack usage, exit semantics, and examples.
    • Makefile builds both bin/rexcrypt and bin/rexcrack.

    Install / Build

    make                 # builds ./bin/rexcrypt and ./bin/rexcrack
    make test            # TAP v14 suite
    # manual:
    # rexcrypt
    clang -Wall -Wextra -W -O2 -Iinclude -o bin/rexcrypt src/rexcrypt.c -lcrypt
    # rexcrack (pthreads)
    clang -Wall -Wextra -W -O2 -Iinclude -o bin/rexcrack src/rexcrack.c -lcrypt -pthread
    

    Quick start

    H="$(./bin/rexcrypt -k hunter2)"
    ./bin/rexcrack -h "$H" -w tests/wordlist.txt -t 8
    

    Notes

    • This project is educational: not a production password subsystem.
    • Algorithm availability and -c semantics depend on your system’s libxcrypt build.
    • Legacy formats are supported to demonstrate why they’re legacy.
    Downloads