i have a code that encrypts data and then i embed it into an image, so when I was checking the encryption and decryption code that worked fine, Also i used blowfish module for encryption.
now problem is that when I embed the data into the image and extract it, It's a bytesarray in plaintext form,
b'\x98\xac\xc3ymQ_\x80\xcb\xec\x9c\x04\xc3@\x88\x93`j\x05\x96\x9d\xcb\x0ec\xb2\x9b(\xd9@\x9fI\x00\xc7h\xe3\x83\xbd0\r\xad}*t'
the above is a bytesarray in plaintext form, So if I try to convert it to bytesarray again it will re-encode it and put the '\' between the characters that already have it and now this new bytesarray is not a normal bytesarray, and the data is corrupted.
bytearray(b"b\'\\x98\\xac\\xc3ymQ_\\x80\\xcb\\xec\\x9c\\x04\\xc3@\\x88\\x93`j\\x05\\x96\\x9d\\xcb\\x0ec\\xb2\\x9b(\\xd9@\\x9fI\\x00\\xc7h\\xe3\\x83\\xbd0\\r\\xad}*t\'")
So my question is that how do I typecast or convert the str to a bytesarray? without changing the data.