repeating key xor

This commit is contained in:
2024-04-09 10:47:34 -07:00
parent 507c690583
commit 321d1ec446
4 changed files with 42 additions and 3 deletions

View File

@ -1,6 +1,6 @@
# crypto
Cryptographic library
Cryptographic tools
## Functions
@ -65,4 +65,21 @@ responsible for freeing the returned string.
```c
const char *hex_to_str(const unsigned char *hex, size_t sz);
```
```
### repeating_key_xor
Performs a repeating-key XOR encryption on an array of bytes. User is responsible for freeing the returned array
```c
const unsigned char* repeating_key_xor(const unsigned char* s, size_t s_sz, const unsigned char* key, size_t k_sz);
```
### repeating_key_xor_s
Performs a repeating-key XOR encryption on a string. Returns the encrypted string as an array of bytes. User is
responsible for freeing the returned array
```c
const unsigned char *repeating_key_xor_s(const char* s, const char* key);
```