Question: C++ #include des56.h #include hex.h #include #include #define DECRYPT 1 #define ENCRYPT 0 /*Compilation: To compile and run this code you will need to link

 C++ #include "des56.h" #include "hex.h" #include #include #define DECRYPT 1 #define

C++

#include "des56.h" #include "hex.h" #include #include

#define DECRYPT 1 #define ENCRYPT 0

/*Compilation: To compile and run this code you will need to link with the other C files in this directory. The easiest solution is to use this compilation command: $ gcc *.c

This will compile all C files in the directory and link the resulting object files to produce a single executable called "a.out". You can run a.out like this: $ ./a.out */

int main() { unsigned char key[8] = {1,2,3,4,5,6,7,8}; printf("The key is (in hex): 0x%s ",bin2hex(key,8));

keysched *ks = malloc(sizeof(keysched)); fsetkey(key,ks); char plaintext[9] = "hilariox";

printf("The plaintext is: %s ",plaintext);

fencrypt(plaintext,ENCRYPT,ks); char* ciphertext=bin2hex(plaintext,8);

printf("The ciphertext is (in hex): 0x%s ",ciphertext);

}

The goal in this project is to find the "round by round" differences between two nearly identical plaintexts. The two plaintexts we will use are: unsigned char Ml [ 8 ] unsigned char M2 [ 8 ] { ' \x01' , ' \x23' , ' \x45' , \x67' , ' \x89" , ' \xab' , ' \Xed' , ' \xef ' } ; { ' \x41' , ' \ x2 3 . ' \ x45 ' , ' \x67' , ' \x89" , ' \xab' , ' \xcd' , ' \xef ' } ; = = And the key for both plaintexts is this: unsigned char K[8]- (0x13,0x34,0x57,0x79,0x9B,0xBC, 0xDF, OxF1) The desired output is $$ (L- ^{M_1}R ^{M.1)) \Oplus (L..! ^(M-2}R_^{M_2})$$ where 2. $\opluss denotes exclusive OR 3. $L_"(M-1 } $ s the left hand state in the $ith round for the plaintext MI, and SR_"(M-1 }$ s the right hand state in the ith round for the plaintext MI. 4. $L-"(M2)s s the left hand state in the $isth round for the plaintext M2, and $R_^{M_2JS is the right hand state in the $isth round for the plaintext M2 In other words for each round we need to find the xOR of the states for that round for the respective p aintexts. The goal in this project is to find the "round by round" differences between two nearly identical plaintexts. The two plaintexts we will use are: unsigned char Ml [ 8 ] unsigned char M2 [ 8 ] { ' \x01' , ' \x23' , ' \x45' , \x67' , ' \x89" , ' \xab' , ' \Xed' , ' \xef ' } ; { ' \x41' , ' \ x2 3 . ' \ x45 ' , ' \x67' , ' \x89" , ' \xab' , ' \xcd' , ' \xef ' } ; = = And the key for both plaintexts is this: unsigned char K[8]- (0x13,0x34,0x57,0x79,0x9B,0xBC, 0xDF, OxF1) The desired output is $$ (L- ^{M_1}R ^{M.1)) \Oplus (L..! ^(M-2}R_^{M_2})$$ where 2. $\opluss denotes exclusive OR 3. $L_"(M-1 } $ s the left hand state in the $ith round for the plaintext MI, and SR_"(M-1 }$ s the right hand state in the ith round for the plaintext MI. 4. $L-"(M2)s s the left hand state in the $isth round for the plaintext M2, and $R_^{M_2JS is the right hand state in the $isth round for the plaintext M2 In other words for each round we need to find the xOR of the states for that round for the respective p aintexts

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!