0

I did RSA/ESB/OAEP encryption of a string and got the below data

b'\xc5G\xe3\xc5n\xdd]\xd2\xc4"\xa1H\xa76\xf0\xcc:C\x9au~d\x0e]\xbfK\x90\xd7\x1a\xc8\xba\xec\x9f\xadr\x8d\x9b\x89/\xedI\x82<(\xbf\xd8\xbc\xe0\x8a\xd98M\xfc\x95z\xfc\xad\xeb\xf5\x83\xa0\x18\x9c\xbb\xf8D\x8c\xdd\xd5{\xe3\x950)\x8a\xe5G\xc4z\xc5\xe2R\x9b\xc5>\x86U\x82\xb06\xdb\xa8^ s\xe2MK\xbd\x88\xe7\xd1`K\x98?\xf1%\xd7\xcf\xa6\x98\xe2\xef\xca\xcb\xeca0\xc7\x8dt\xd2\x83\x97\x03~x\x11>\xc2\xe9\xaaq\x9bT\xd8:I\xa6 \x11"\xd0\xb2jr\x9a\xb6\xa7\xe9\xdcL\xdaR\x95\x85\xf2gH\x1b\x13\xfaAxAm\xeb\xbb\xd2\x161\xc2\x19QU\xc3\xb5\xf9\xe1\x94'

Could you let me what is the type of above data which has all \x in it. If its hex, then it should only have two characters after \x right? How do I convert it to a normal ASCII string?

Kalyan Kumar
  • 399
  • 3
  • 14
  • 1
    This is binary data, with a mix of \x*nn* hex and printable characters that appear as is. Example: in the beginning: \xc5 then G then \xe3 – Tarik May 05 '21 at 05:22
  • 1
    You can't encode these bytes to ASCII because they contain bytes outside the ASCII range. However you can convert them to a string of hex characters, as described in the linked duplicate. – snakecharmerb May 05 '21 at 06:07

0 Answers0