Realize my 'fixed' XOR is already repeating-key
This commit is contained in:
parent
7a18aab19b
commit
b8f9f6f247
|
@ -3,13 +3,13 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
/*
|
||||
void fixed_xor_stream(uint8_t *key, size_t key_len)
|
||||
void repeating_key_xor_stream(uint8_t *key, size_t key_len)
|
||||
{
|
||||
//
|
||||
}
|
||||
*/
|
||||
|
||||
void fixed_xor(const uint8_t *data, const size_t data_len,
|
||||
void repeating_key_xor(const uint8_t *data, const size_t data_len,
|
||||
const uint8_t *key, const size_t key_len)
|
||||
{
|
||||
uint8_t c;
|
||||
|
@ -30,7 +30,7 @@ int main()
|
|||
uint8_t key[] = "\x68\x69\x74\x20\x74\x68\x65\x20\x62\x75\x6c\x6c\x27"
|
||||
"\x73\x20\x65\x79\x65";
|
||||
|
||||
fixed_xor(data, sizeof(data)-1, key, sizeof(key)-1);
|
||||
repeating_key_xor(data, sizeof(data)-1, key, sizeof(key)-1);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Loading…
Reference in New Issue