A header-only implementation of RC4 in C.
- C 96.3%
- Shell 3.7%
| src | ||
| tests | ||
| .gitignore | ||
| build.sh | ||
| ReadMe.md | ||
| UNLICENSE | ||
RC4 Cipher
Overview
This program is an implementation of the RC4.
https://en.wikipedia.org/wiki/RC4
It is designed to work with text-based input.
The code is written as a "header-only" implementation.
Build
Use the following command to build the program:
./build.sh
Usage
To encrypt a string:
./bin/rc4 -k Secret -e "Attack at dawn"
The above command returns:
45A01F645FC35B383552544B9BF5
To decrypt a string:
./bin/rc4 -k Secret -d 45A01F645FC35B383552544B9BF5
The above command returns:
Attack at dawn
Test
To confirm the code handles memory allocation correctly:
valgrind --leak-check=full --verbose ./bin/rc4 -k password -e "Attack at dawn"
To test the code:
cd tests
./test.sh