I have a given simple code snippet that is supposed to generate a 128-bit encryption key. How do I print out the values to the console? Here's the code:
#include <stdio.h>
#include <stdlib.h>
#define LEN 16 // 128 bits
void main()
{
unsigned char *key = (unsigned char *) malloc(sizeof(unsigned char)*LEN);
FILE* random = fopen("/dev/urandom", "r");
fread(key, sizeof(unsigned char)*LEN, 1, random);
fclose(random);
}
To be more specific: the instructions say: "Print out the numbers."