From 4a9770b8ba9d86db12779f5ae00366bce60a42ad Mon Sep 17 00:00:00 2001 From: Benedict Date: Sat, 19 Mar 2016 13:44:55 +0100 Subject: completed task6 nearly completly just a few characters are still wrong in the key. freqencies analysis has to be made more comprehensive --- task5.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'task5.c') diff --git a/task5.c b/task5.c index f110e30..15e4568 100644 --- a/task5.c +++ b/task5.c @@ -3,13 +3,13 @@ /* * implements task 5 of set 1 of matanso challange */ -void main() +int main() { char *stanze = "Burning 'em, if you ain't quick and nimble\nI go crazy when I hear a cymbal"; char *result = malloc(strlen(stanze)); - char *printable = malloc(strlen(stanze)*5); + char *printable = malloc(strlen(stanze)*2+1); xor_string(stanze, "ICE", result, 3, strlen(stanze)); - hex_binary_to_string(result, printable, 2*strlen(stanze)); + hex_binary_to_string(result, printable, strlen(stanze)); printf("%s\n", printable); } -- cgit v1.2.3-70-g09d2