diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-12-30 00:32:18 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-30 00:32:18 +0100 |
commit | fb7c5cf5845c22bb751c824679c856b45a1bb970 (patch) | |
tree | e926af96072d82935d09b49136bfb7bd5bcf7cd3 /module/plugins | |
parent | [MegaCoNz] Fixup (diff) | |
download | pyload-fb7c5cf5845c22bb751c824679c856b45a1bb970.tar.xz |
[MegaCoNz] Fixup (2)
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hoster/MegaCoNz.py | 8 |
1 files changed, 4 insertions, 4 deletions
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) |