Compare commits
3 Commits
854ec1259d
...
7fc146f745
Author | SHA1 | Date | |
---|---|---|---|
7fc146f745 | |||
806cdc62c6 | |||
d6658a8e4f |
@ -81,7 +81,7 @@ why2_output_flags why2_encrypt_text(char *text, char *key)
|
||||
}
|
||||
|
||||
//PADDING
|
||||
if (why2_get_flags().padding > 0) //TODO! this breaks when used with long strings or byte input
|
||||
if (why2_get_flags().padding > 0)
|
||||
{
|
||||
why2_list_t split_text = WHY2_LIST_EMPTY; //LIST OF text SPLIT INTO CHARS
|
||||
|
||||
|
@ -289,6 +289,7 @@ void why2_generate_text_key_chain(char *key, int *text_key_chain, int text_key_c
|
||||
int number_buffer;
|
||||
int number_buffer_2 = 0;
|
||||
int number_buffer_3 = 0;
|
||||
const unsigned long key_length = why2_get_key_length();
|
||||
int (*cb)(int, int);
|
||||
|
||||
for (int i = 0; i < text_key_chain_size; i++)
|
||||
@ -306,17 +307,17 @@ void why2_generate_text_key_chain(char *key, int *text_key_chain, int text_key_c
|
||||
|
||||
case WHY2_v2:
|
||||
number_buffer_2 = i;
|
||||
number_buffer_3 = why2_get_key_length() - (number_buffer + (i < text_key_chain_size));
|
||||
number_buffer_3 = key_length - (number_buffer + (i < text_key_chain_size));
|
||||
break;
|
||||
|
||||
case WHY2_v3:
|
||||
number_buffer_2 = text_key_chain_size - (i + 1);
|
||||
number_buffer_3 = why2_get_key_length() - (number_buffer + (i < text_key_chain_size));
|
||||
number_buffer_3 = key_length - (number_buffer + (i < text_key_chain_size));
|
||||
break;
|
||||
|
||||
case WHY2_v4:
|
||||
number_buffer_2 = text_key_chain_size - (i + 1);
|
||||
number_buffer_3 = ((((((i ^ number_buffer_2) + ((number_buffer << 3) ^ (number_buffer_2 & 0xF))) * (text_key_chain_size ^ (why2_get_key_length() >> 2))) ^ ((~(number_buffer + text_key_chain_size)) & 0xA7)) + (i % 7)) * (((number_buffer_2 | (i & 0xF)) + (why2_get_key_length() >> 3)) ^ (text_key_chain_size * (number_buffer & 0x3F))) + (((i << 4) ^ (text_key_chain_size >> 1)) & 0x1234) - ((i * number_buffer_2) % (why2_get_key_length() | text_key_chain_size))) % why2_get_key_length(); //gl fucker
|
||||
number_buffer_3 = ((((((i ^ number_buffer_2) + ((number_buffer << 3) ^ (number_buffer_2 & 0xF))) * (text_key_chain_size ^ (key_length >> 2))) ^ ((~(number_buffer + text_key_chain_size)) & 0xA7)) + (i % 7)) * (((number_buffer_2 | (i & 0xF)) + (key_length >> 3)) ^ (text_key_chain_size * (number_buffer & 0x3F))) + (((i << 4) ^ (text_key_chain_size >> 1)) & 0x1234) - ((i * number_buffer_2) % (key_length | text_key_chain_size))) % key_length; //gl fucker
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ int main(void)
|
||||
0,
|
||||
WHY2_v4,
|
||||
WHY2_OUTPUT_TEXT,
|
||||
0
|
||||
WHY2_RECOMMENDED_PADDING_RATE(strlen(WHY2_LOGGER_TEST_TEXT))
|
||||
}
|
||||
);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user