Question: C++ XOR two strings. I am trying to XOR two strings 00112233445566778899AABBCCDDEEFFAABB060606060606 and 4ca00fd6dbf1fb284ca00fd6dbf1fb284ca00fd6dbf1fb28 my program is giving me: SPTWPVSPT[X q'&t'!u#'t~u#rPTTTVVT as a result However,

C++ XOR two strings.

I am trying to XOR two strings

00112233445566778899AABBCCDDEEFFAABB060606060606

and

4ca00fd6dbf1fb284ca00fd6dbf1fb284ca00fd6dbf1fb28

my program is giving me: SPTWPVSPT[X q'&t'!"u#'t~u"#rPTTTVVT as a result

However, when i go to http://xor.pw/? and input the two hexadecimal strings in I get the result: 4cb12de59fa49d5fc439a56d172c15d7e61b09d0ddf7fd2e

what am I doing wrong in my program below?

// plaintext value here string pthex = "00112233445566778899AABBCCDDEEFFAABB"; // IV value here string sHex = "4ca00fd6dbf1fb28"; string PaddedPlainText = pthex + "060606060606"; //added the pad //cout<

int PPTextLength = PaddedPlainText.length(); // length of plaintext int BlockCounter = (PPTextLength / 16); // number of blocks to process cout<<"Pa: "<

string XORval; string vXOR;

for (int i=1; i<=BlockCounter; i++) { cout<<"I is: "<< i< 1) for (int j =((i*16)-16); j < (((i)*16));j++) { // cout<<"the value of i: "<

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!