Hi, i need to read last 32 byte of a binari file and use them as array of hex (it's a key for decryption).
if i use an hardcoded key like
unsigned char aesKey[32] = {
0x53, 0x28, 0x40, 0x6e, 0x2f, 0x64, 0x63, 0x5d, 0x2d, 0x61, 0x77, 0x40, 0x76, 0x71, 0x77, 0x28,
0x74, 0x61, 0x7d, 0x66, 0x61, 0x73, 0x3b, 0x5d, 0x66, 0x6d, 0x3c, 0x3f, 0x7b, 0x66, 0x72, 0x36
};
it works, but if i try to create the aesKey array from hex values readed from file, it crash.
any ideas?
additional information copied from non-solution below
this is how i read the last 32 byte from my file:
char *chiavegiusta;
inFile.open(filename, ios::binary);
inFile.seekg(-32, ios::end);
inFile.read((char *)chiavegiusta, 32);
inFile.close();
my problem is how to create an hex array from these values.