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
|
void main()
{
int a;
unsigned char CipherKey[16] = {0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C};
unsigned char PlainText[16] = {0x32, 0x43, 0xF6, 0xA8, 0x88, 0x5A, 0x30, 0x8D, 0x31, 0x31, 0x98, 0xA2, 0xE0, 0x37, 0x07, 0x34};
for(a=0;a<16;a++)
{
Key[a] = CipherKey[a];
input[a] = PlainText[a];
}
KeyExpansion();
Cipher();
cout << endl;
cout << "Encryted output text:" << endl;
for(a=0;a<16;a++) // For loop is used to print every character of the output array onto the console
{
printf("%02x ",output[a]); // printf is used in order to print the encrypted text in hexidecimal
}
cout << endl;
}
|