Question: Please write a code in c++/python that can produce answers. Please do all of them. Don't copy and paste from Chegg. I have posted 2
Please write a code in c++/python that can produce answers. Please do all of them. Don't copy and paste from Chegg. I have posted 2 times before and they gave me the wrong answers.

(1 point) This question concerns block cipher modes. We will use a simple affine cipher, which can be expressed in C as follows. char cipher(unsigned char block, char key) \{ return (key+11block)%256; 3 Note that the block size is 8 bits, which is one byte (and one ASCIl character). We will work with the fixed key 0x08. We now encrypt various plaintexts using modes for this cipher. In every case in which the mode requires an IV, the IV will be OxAA. In the case of CTR mode, we use a (nonce counter) arrangement in which the nonce is the left 5 bits of 0AA and the counter is a 3 bit counter that begins at 0 . In all of the problems given below, one character is one block. Each character of the plaintext should be regarded as its corresponding ASCIl code. a) Encrypt the plaintext "forty" using CTR mode. Please enter your answer in hex. (Please do **ot" enter an 0x, as this has been done.) 0x b) Encrypt the plaintext " f ifty" using ECB mode. Please enter your answer in hex. 0x c) Encrypt the plaintext "nifty" using CFB mode. Please enter your answer in hex. 0x d) Encrypt the plaintext "thrifty" using CBC mode. Please enter your answer in hex. 0x e) Encrypt the plaintext "spiffty" using OFB mode. Please enter your answer in hex. 0x
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
