A simple C library for encrypting and decrypting data in a custom Vigenère cipher, suited for raw bytes.
To include the library in your project, simply include the src/bingenere.h
header into your C code and add the src/bingenere.c
file when compiling together with your code. With GCC and a simple script, it would look something like this: gcc /path/to/your_code.c /path/to/bingenere.c -o /path/to/executable
.
To build the examples in src/examples/
, run:
make examples
That will generate the executables in the build/
directory.
uint8_t* bingenere_encrypt(uint8_t* data, uint8_t* key);
Encrypt a data byte array (an array of unsigned chars) with a key (also a byte array) using the binary Vigenère cipher.
Arguments:
uint8_t* data
: an array of unsigned chars, containing the data for encryption.uint8_t* key
: an array of unsigned chars, containing the key for encryption.
Returns: an array of unsigned chars, containing the encrypted bytes.
uint8_t* bingenere_decrypt(uint8_t* data, uint8_t* key);
Decrypt a data byte array (an array of unsigned chars) with a key (also a byte array) using the binary Vigenère cipher.
Arguments:
uint8_t* data
: an array of unsigned chars, containing the data for decryption.uint8_t* key
: an array of unsigned chars, containing the key for decryption.
Returns: an array of unsigned chars, containing the decrypted bytes.
To test the library, simply run:
make tests
That will compile and run all of the implemented tests.
This project is licensed under the MIT License - see the LICENSE file for details.