An open API service indexing awesome lists of open source software.

https://github.com/mochabyte0x/chacha20

ChaCha20 encryption implemented in C/C++ (Header Only)
https://github.com/mochabyte0x/chacha20

c chacha20 cpp encryption-algorithms

Last synced: 21 days ago
JSON representation

ChaCha20 encryption implemented in C/C++ (Header Only)

Awesome Lists containing this project

README

          

# ChaCha20

Usage:

```C
// Initialize context
struct chacha20_context ctx;

// Define your KEY (32-Byte)
unsigned char CHACHA20_KEY[32] = { };

// Define your Nonce (12-Byte)
unsigned char CHACHA20_NONCE[12] = { };

// After those intializations, you can encrypt / decrypt your buffer using the same function
chacha20_init_context(&ctx, CHACHA20_KEY, CHACHA20_NONCE, 0);
chacha20_xor(&ctx, pBuffer, dwSize); // Encrypt or Decrypt
SecureZeroMemory(&ctx, sizeof(ctx)); // Optional

```