Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bemxio/binary-vigenere
A C library for encrypting/decrypting data in a binary Vigenère cipher
https://github.com/bemxio/binary-vigenere
binary-vignere-cipher bytearray c library unit-testing vigenere vigenere-cipher
Last synced: about 1 month ago
JSON representation
A C library for encrypting/decrypting data in a binary Vigenère cipher
- Host: GitHub
- URL: https://github.com/bemxio/binary-vigenere
- Owner: bemxio
- License: mit
- Created: 2022-11-11T16:13:21.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-10T07:32:49.000Z (3 months ago)
- Last Synced: 2024-09-10T09:51:01.541Z (3 months ago)
- Topics: binary-vignere-cipher, bytearray, c, library, unit-testing, vigenere, vigenere-cipher
- Language: C
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bigenere
A simple C library for encrypting and decrypting data in a custom [Vigenère cipher](https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher), suited for raw bytes.## Building
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:
```sh
make examples
```That will generate the executables in the `build/` directory.
## Usage
### Encrypting
```c
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.
### Decrypting
```c
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.
## Testing
To test the library, simply run:```sh
make tests
```That will compile and run all of the implemented tests.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.