Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The following describes a toy block cipher. The block size is 8 bits and the key

ID: 3600307 • Letter: T

Question

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 first 8 bits of the round subkey 2. The input, considered as an element of GF(28) with irreducible P(r) = z8 + z4 + z3 + z + l. 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 first round, the subkey is the first 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-8x88.

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;
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote