blob: 19a723588950a7672b8a4b77bbae5a5d89d9ed33 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#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, 0);
printf("%s\n", cleartext);
free(decoded_content);
free(cleartext);
return 0;
}
|