From fb7c5cf5845c22bb751c824679c856b45a1bb970 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 30 Dec 2014 00:32:18 +0100 Subject: [MegaCoNz] Fixup (2) --- module/plugins/hoster/MegaCoNz.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/hoster/MegaCoNz.py b/module/plugins/hoster/MegaCoNz.py index 39eba4a40..00f38ff06 100644 --- a/module/plugins/hoster/MegaCoNz.py +++ b/module/plugins/hoster/MegaCoNz.py @@ -68,6 +68,8 @@ class MegaCoNz(Hoster): def getCipherKey(self, key): """ Construct the cipher key from the given data """ + key = self.b64_decode(key) + k = key[0] ^ key[4], key[1] ^ key[5], key[2] ^ key[6], key[3] ^ key[7] iv = key[4:6] + (0, 0) meta_mac = key[6:8] @@ -87,7 +89,7 @@ class MegaCoNz(Hoster): def decryptAttr(self, data, key): - k, iv, meta_mac = self.getCipherKey(self.b64_decode(key)) + k, iv, meta_mac = self.getCipherKey(key) cbc = AES.new(k, AES.MODE_CBC, "\0" * 16) attr = cbc.decrypt(self.b64_decode(data)) @@ -102,10 +104,8 @@ class MegaCoNz(Hoster): def decryptFile(self, key): """ Decrypts the file at lastDownload` """ - key = self.b64_decode(key) - # upper 64 bit of counter start - n = key[16:24] + n = self.b64_decode(key)[16:24] # convert counter to long and shift bytes k, iv, meta_mac = self.getCipherKey(key) -- cgit v1.2.3