A simple C cryptography library and command-line tool for encrypting and decrypting data using a custom stream cipher.
- Shared C library (
libcrypt.so) with a simple stream cipher API - Command-line tool (
crypt) for file and stream encryption/decryption - Unit tests (Unity framework)
- Integration tests for CLI
Requires GCC and GNU Make.
make all # Build library and CLI
make test # Run unit tests
make check # Run unit and CLI integration tests
make clean # Remove build artifactsTo build with debug symbols:
make clean
make DEBUG=1 allEncrypt a file:
./crypt -k 001122334455 -o encrypted.bin input.txtDecrypt a file:
./crypt -k 001122334455 encrypted.bin > decrypted.txtUse a key file:
echo -n -e '\x01\x02\x03\x04\x05\x06' > keyfile
./crypt -f keyfile input.txt > encrypted.bin
./crypt -f keyfile encrypted.bin > decrypted.txtUse as a filter:
echo "hello world" | ./crypt -k 001122334455 | ./crypt -k 001122334455See lib/include/crypt.h for API documentation.
Run all tests:
make check- Unit tests:
make test(runs with Unity) - CLI integration tests:
bash ./test_cli.sh
lib/- Library source and headerscli/- Command-line tool sourcetest/- Unit teststest_cli.sh- CLI integration test scriptMakefile- Build and test automation