Are there attacks on AES with 16-bit keys? Are there known attacks on AES that uses a 16-bit key?
Assuming the data can be 95MB size, and that I can request the same data over and over.

For example, can someone explain to me how this code vulnerable? I know my around C, but can’t seems to find anything here. Usual CRIME attack won’t work.

#include &lt;string.h&gt;
#define MAX_SIZE 100000000
#define MAX_NAME_LENGTH 1000

unsigned char shared_key[16]={0x01,0x23,0x45,0x67,0x89,
0xab,0xcd,0xef,0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef};

char directory_location[50]="../../server_directory/";
char *file_to_string (char *output_string,
FILE *input_file, int *length);

FILE *compress(char *input);

FILE *encrypt(unsigned char *key, FILE *input);

void application_send (FILE *output);

int get_file (char *name, unsigned int name_length)
{

FILE *input, *compressed_file, *encrypted_file;

int file_length;

char uncompressed[MAX_SIZE];

char file_string[MAX_SIZE];

char filename [MAX_NAME_LENGTH];

if (name_length &gt;= MAX_NAME_LENGTH-50)

return -1;

strcpy(filename,directory_location);

strcat(filename,name);

input = fopen(filename,"r");

if (input == NULL)

return -1;

file_to_string (file_string, input, &amp;file_length);

memcpy(uncompressed,name,name_length);

memcpy(uncompressed+name_length,file_string,file_length);

compressed_file = fopen("compressed","w");


if (compressed_file == NULL)

return -1;

encrypted_file = fopen("encrypted","w");

if (encrypted_file == NULL)

return -1;

compressed_file = compress (uncompressed);

encrypted_file = encrypt (shared_key, compressed_file);

application_send (encrypted_file);

return 0;
}
There is no such thing as a 16 bit AES key. AES is a block cipher with a block size of 128 bits and a key size of 128, 192 or 256 bits. As a block cipher, AES can only encrypt 16 bytes (128) bits at a time. AES in itsef is not (CPA) secure as repetition of the plaintext would lead to repetitions of the ciphertext.

To encrypt larger amounts of data, AES needs to be used as primitive in a block cipher mode of operation. Although block cipher mode of operations of course depend on the (high) security of AES, they have their own security boundaries. ECB is not secure at all, CBC needs a randomized IV, CTR needs a unique nonce and has limitations on the size of the input.

The practicalities of establishing the mode and parameters such as the IV depend on the protocol. You would have to examine the protocol, mode and cipher to establish if your use case is secure or not. This would also depend on the attacks you're willing to allow. For instance, just using AES in CBC mode of operation does not protect against man-in-the-middle attacks at all.