-
v2.0.1 Stable
released this
2025-10-13 21:32:53 +00:00 | 66 commits to main since this releaseRexCrypt v2.0.1
Teaching-focused release of a small, readable
crypt(3)demo with a clean CLI, strong inline commentary, and a black-box TAP test harness.Highlights
- Non-TTY handling: if stdin isn’t a TTY and
-kisn’t provided, RexCrypt exits with a helpful hint instead of prompting. -k -(stdin): read the secret from standard input for scripting; trailing newline is trimmed.- Length bound: passphrase input is capped by
CRYPT_MAX_PASSPHRASE_SIZE(commonly 512 bytes) to matchstruct crypt_data. - Built-in help (
-?): conciseusage()with options, algorithm table, and examples (printed to stderr for easy piping). - TAP v14 tests:
make testruns a small suite that treats RexCrypt as a black box (prefix checks, stdin path, non-TTY error path). - Safer memory handling: fix and use a standards-compliant
copymem()demo. - Clean repo layout:
src/for the tool,tests/for the TAP harness + comparators,bin/for outputs.
CLI
rexcrypt [-c <cpu_tim>] [-r <resalt>] [-a <alg>] [-k <key>|-]-c <cpu_tim>: library-defined cost/rounds/time knob (unsigned long).-r <resalt>: respin the salt N extra times after the first generation (default 0).-a <alg>: algorithm selector (0..9, a, b) – availability depends on your libxcrypt build.-k <key>: provide the secret inline; omit to be prompted viagetpass().-k -: read the secret from stdin (for scripting; echo is not disabled).
Build / Test
make # builds ./bin/rexcrypt make test # runs TAP v14 testsRequires a C compiler (clang/gcc) and libxcrypt/
libcryptheaders + library.Notable changes since 1.x
- New non-TTY check &
-k -code path. - Input buffer sized to
CRYPT_MAX_PASSPHRASE_SIZEto matchcrypt_rlimits. - Usage/help text expanded; README synced with CLI behavior.
- TAP harness upgraded and modularized (
tests/with comparator modules). - Minor fixes and comment cleanups to keep the code strictly C-portable and student-friendly.
Notes
- The tool is educational, not a drop-in production password solution.
- Algorithm availability and exact semantics of
-cdepend on your system’s libxcrypt build.
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
1 download
- Non-TTY handling: if stdin isn’t a TTY and