well ,i have an assignment to implement the operation modes of the DES algorithm in CBC mode : i am stuck at the point where the output of the encryption function gives bytes like this : b'\xe4\x06-\x95\xf5!P4' (i am using DES library from Crypto.Cipher)
i don't know what is that representation or how to convert it to a binary string of zeros and ones , to xor it with the 2nd plain text.
any help would be highly appreciated
iv = random_iv()
des = DES.new(key)
plaintext1=""
#convert it into binary
plaintext1=bin(int.from_bytes(arr[0].encode(), 'big'))[2:]
y = fn.xor(plaintext1 ,iv)
y1='0'+'b'+y
y= int(y1, 2)
#y is the string output of xoring plaintext1 with the IV
y= y.to_bytes((y.bit_length() + 7) // 8, 'big').decode()
encrypted_blocks=[]
# arr is the array of the original blocks of the msg.
for i in range (1, len(arr)):
c = des.encrypt(y)
print(c)
encrypted_blocks.append(c)
### stuck here ###
#### don't know how to work with c in that format ######