Question 4 The following describes a toy block cipher. The block size is 8 bits
ID: 3605914 • Letter: Q
Question
Question 4
The following describes a toy block cipher. The block size is 8 bits and the key size is 16 bits. A
round will consist of the following.
1. The input is XORed with the rst 8 bits of the round subkey
2. The input, considered as an element of GF(28) with irreducible P(x) = x8 + x4 + x3 + x + 1, is squared.
3. The left 4 bits of the block are swapped with the right 4 bits of the block. For example 0x4A becomes 0xA4.
There are two rounds. The key schedule is the following:
1. During the rst round, the subkey is the rst 8 bits of the key.
2. During the second round, the subkey is the second 8 bits of the key.
Question 4 part a
Use the above cipher with key k = 0x1111 to encrypt the block B = 0x88.
Answer here
Question 4 part b
Use this block cipher to encrypt the plaintext x =0x4A01 in OFB mode with IV =0x22 and key
k =0x4444. Please show all intermediate steps.
Explanation / Answer
include "FlashDrive.h"
using namespace std;
using namespace cs52;
void main( )
{
cs52::FlashDrive drive1( 10, 0, false );
cs52::FlashDrive drive2( 20, 0, false );
drive1.plugIn( );
drive1.formatDrive( );
drive1.writeData( 5 );
drive1.pullOut( );
drive2.plugIn( );
drive2.formatDrive( );
drive2.writeData( 1 );
drive2.pullOut( );
cs52::FlashDrive combined = drive1 + drive2;
cout << "this drive's filled to " << combined.getUsed( ) << endl;
cs52::FlashDrive other = combined – drive1;
cout << "the other cup's filled to " << other.getUsed( ) << endl;
if (combined > other) {
cout << "looks like combined is bigger..." << endl;
}
else {
cout << "looks like other is bigger..." << endl;
}
if (drive2 > other) {
cout << "looks like drive2 is bigger..." << endl;
}
else {
cout << "looks like other is bigger..." << endl;
}
if (drive2 < drive1) {
cout << "looks like drive2 is smaller..." << endl;
}
else {
cout << "looks like drive1 is smaller..." << endl;
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.