0

I'm playing a game that I believe uses a base64-encoded save, and I'm trying to figure out how to get a json or something equivalent of the save in python.

First, I'm decoding it from base64 (using base64.b64decode), which gives me bytes that look like

b'Salted__\x98&v\\\x99\xa8\xbb\x10\xaa"\xbbf\xea\x99\xbf}\x95\x96\xd0\xba~\xef@\x00\x16v\x01\xa5\x11=\xfa;\xc0\xec\xcb\x95h\xfcH\...

when printed. I'm having trouble decoding the bytes, however. Doing decoded_bytes.decode() gives an error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x98 in position 8: invalid start byte I've tried passing a few different encodings to decode, but none of them seem to work. It looks like the first 8 bytes are a salt, but removing those 8 and trying to decode doesn't work either. Any help would be greatly appreciated.

  • that is an encrypted bytestring so you would need to decrypt it with a key that matched the key it was encrypted with it would be something like `key=sha256("password"+"some_salt")` and then passed to some standard encryption algorithm ... you need to try and find the password (which can maybe be found somewhere with something like `strings program.exe` maybe – Joran Beasley Jul 21 '22 at 00:31
  • Does this answer your question? [Python and OpenSSL: unable to decrypt](https://stackoverflow.com/questions/40302988/python-and-openssl-unable-to-decrypt) – JosefZ Jul 21 '22 at 08:17

0 Answers0