|
C Fundamentals
Algorithms · data structures · cryptography · systems — pure C11, zero deps
|
XOR stream cipher — repeating key. More...
#include <stddef.h>Go to the source code of this file.
Functions | |
| void | xor_apply (unsigned char *text, size_t len, const unsigned char *key, size_t keylen) |
XOR stream cipher — repeating key.
The same function encrypts and decrypts (XOR is its own inverse). NOT cryptographically secure on its own — included as a teaching primitive and a building block for one-time-pad demonstrations.
Definition in file xor_cipher.h.
| void xor_apply | ( | unsigned char * | text, |
| size_t | len, | ||
| const unsigned char * | key, | ||
| size_t | keylen | ||
| ) |
XOR each byte of text[0..len) with the cyclic key.
Definition at line 7 of file xor_cipher.c.
Referenced by main().