Following @Artjom B. 's outline, I was able to decrypt the MySQL "junk" using the following code (python 3.12).
from hashlib import md5
from Crypto.Cipher import DES3
class MySQLDES:
def __init__(self, password):
passbytes = password.encode()
key = md5(passbytes).digest() # 16 bytes
key += md5(key + passbytes).digest() # extend to 32 bytes
key = DES3.adjust_key_parity(key[:24]) # take first 24
self.cipher = DES3.new(
key,
DES3.MODE_CBC,
iv=bytes.fromhex('00') * 8)
def decrypt(self, hexstr):
cipherbytes = bytes.fromhex(hexstr)
clearbytes = self.cipher.decrypt(cipherbytes[1:])
clearbytes = clearbytes[:-clearbytes[-1]]
return clearbytes.decode()
Usage:
des = MySQLDES('<password>')
des.decrypt('<hex string starting with FF>')