diff options
| author | Benedict <benedict@0xb8000.de> | 2016-03-21 21:32:46 +0100 |
|---|---|---|
| committer | Benedict <benedict@0xb8000.de> | 2017-02-21 13:00:25 +0100 |
| commit | 27a1b8050d2170b40024fe82cb27088f3c676f26 (patch) | |
| tree | c27966b7aeb1e4eb4fe889e6b7fc9a6cd68a5b17 /set2/task10.c | |
| parent | 95b1e82c4fca864600108d4e36ceadbb290a76f3 (diff) | |
completed set2, challenge 10
Diffstat (limited to 'set2/task10.c')
| -rw-r--r-- | set2/task10.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/set2/task10.c b/set2/task10.c new file mode 100644 index 0000000..fb8d0c1 --- /dev/null +++ b/set2/task10.c @@ -0,0 +1,30 @@ +#include "../lib/lib.h" +#include "../lib/lib2.h" + + +int main(int argc, char **argv) +{ + int read = 0, len = 0; + char *cleartext; + char *file_content; + char *decoded_content; + int decoded_content_length = 0; + int file_length = 0; + char *string_key = "YELLOW SUBMARINE"; + char iv[16]; + + memset(iv, 0, 16); + + // file is base64 + file_length = read_base64_file("10.txt", &file_content); + // decode base64 + decoded_content = malloc(file_length); + decoded_content_length = decode_base64(file_content, decoded_content); + cleartext = malloc(decoded_content_length+1); + // aes cbc + aes_cbc(decoded_content, decoded_content_length, cleartext, string_key, iv); + printf("%s\n", cleartext); + free(decoded_content); + free(cleartext); + return 0; +} |
