From 2789cee331142f12a0c79c620ad178fe9d92604b Mon Sep 17 00:00:00 2001 From: 2Weak2Live <2weak2live@gmail.com> Date: Wed, 13 Jan 2021 22:44:11 -0500 Subject: [PATCH] Fix python3 encoding problem in voucher decryption --- DeDRM_plugin/ion.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DeDRM_plugin/ion.py b/DeDRM_plugin/ion.py index 3eeef3c..de21ca7 100644 --- a/DeDRM_plugin/ion.py +++ b/DeDRM_plugin/ion.py @@ -815,18 +815,18 @@ class DrmIonVoucher(object): addprottable(self.envelope) def decryptvoucher(self): - shared = "PIDv3" + self.encalgorithm + self.enctransformation + self.hashalgorithm + shared = ("PIDv3" + self.encalgorithm + self.enctransformation + self.hashalgorithm).encode('ASCII') self.lockparams.sort() for param in self.lockparams: if param == "ACCOUNT_SECRET": - shared += param + self.secret + shared += param.encode('ASCII') + self.secret elif param == "CLIENT_ID": - shared += param + self.dsn + shared += param.encode('ASCII') + self.dsn else: _assert(False, "Unknown lock parameter: %s" % param) - sharedsecret = obfuscate(shared.encode('ASCII'), self.version) + sharedsecret = obfuscate(shared, self.version) key = hmac.new(sharedsecret, b"PIDv3", digestmod=hashlib.sha256).digest() aes = AES.new(key[:32], AES.MODE_CBC, self.cipheriv[:16])