Course Solutions Uncategorized (Solved) : Fix Functions File Modesc Output Desired Output Plaintext Motherciphertext 0x2d2422090905p Q27985424 . . . .

(Solved) : Fix Functions File Modesc Output Desired Output Plaintext Motherciphertext 0x2d2422090905p Q27985424 . . . .

 

Fix the functions in the file modes.c so that the outputis the desired output:

plaintext: motherciphertext: 0x2D2422090905plaintext: soldierciphertext: 0xF9CDAC548B5FEEplaintext: riskciphertext: 0x24FD940Fplaintext: endlessciphertext: 0xEDA9D7110425BAplaintext: hairciphertext: 0x3EDB6F38

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include “hex.h”
#include <assert.h>

/*The block cipher*/
char cipher(unsigned char block, char key)
{ //this is an affine cipher where “a” is fixed at 11 andb=key
return (key+11*block)%256;
}

/*The inverse of the block cipher*/
char inv_cipher(unsigned char block, char key)
{ // 163 is the inverse of 11 mod 256
return (163*(block-key+256))%256;
}

void ofb(char* pt, char key, char iv, int len)
{
/*fix me*/
}

void ecb(char* pt, char key, char iv, int len)
{
/*fix me*/
}

void ecb_dec(char* ct, char key, char iv, int len)
{
/*fix me*/
}

void cfb(char* pt, char key,

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Implement Class Point Contains Coordinates Point X Y Provide Following Operations Construc Q37764430 . . . .(Solved) : Implement Class Point Contains Coordinates Point X Y Provide Following Operations Construc Q37764430 . . . .

<ol><li>Implement class Point that contains: the coordinates of a pointx and y. It should provide the following operations:<ol style="list-style-type:lower-alpha;"><li>Constructor that takes x and y as arguments</li><li>Default constructor that initializes x