CBC decryption XOR confusion [duplicate]

QuestionsCategory: QuestionsCBC decryption XOR confusion [duplicate]
Brightn-n-Fresh Staff asked 1 year ago

This question already has an answer here:

I'm trying to implement the padding oracle attack in DES. My understanding of the CBC decryption process (or at least what I was told in class) is this:

Say our cipher text is only two blocks, C0 and C1. The decryption process is then C0 XORed with C1, and then decrypted. Following that, the oracle checks the padding and returns either True or False.

My question is around the XOR, i'm not understanding how to XOR two string values in python (i'm very new to everything about this).

So if i have the values:

C0 = 'f20bdba6ff29eed7'
C1 = '58b1ffb4210a580'

How do i go about XORing the two so i can see if the oracle is returning the correct value or not?

EDIT: I've tried the code in: how to do bitwise exclusive or of two strings in python?

But i get a weird looking output, which is why i posted a separate question. Any help would be appreciated thanks

Terminal Output