Skip to content

liamhickey2/crypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crypto Library and CLI

A simple C cryptography library and command-line tool for encrypting and decrypting data using a custom stream cipher.

Features

  • 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

Build

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 artifacts

To build with debug symbols:

make clean
make DEBUG=1 all

Usage

CLI

Encrypt a file:

./crypt -k 001122334455 -o encrypted.bin input.txt

Decrypt a file:

./crypt -k 001122334455 encrypted.bin > decrypted.txt

Use 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.txt

Use as a filter:

echo "hello world" | ./crypt -k 001122334455 | ./crypt -k 001122334455

Library

See lib/include/crypt.h for API documentation.

Testing

Run all tests:

make check
  • Unit tests: make test (runs with Unity)
  • CLI integration tests: bash ./test_cli.sh

Project Structure

  • lib/ - Library source and headers
  • cli/ - Command-line tool source
  • test/ - Unit tests
  • test_cli.sh - CLI integration test script
  • Makefile - Build and test automation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors