Exemple #1
0
 def _gkdecrypt(self, key, str):
     try:
         key += (24 - len(key)) * '\0'
         decrypter = pyaes.Decrypter(pyaes.AESModeOfOperationECB(key))
         str = decrypter.feed(str.decode('hex')) + decrypter.feed()
         str = str.split('\0', 1)[0]
         return str
     except:
         return
Exemple #2
0
def evp_decode(cipher_text, passphrase, salt=None):
    cipher_text = base64.b64decode(cipher_text)
    if not salt:
        salt = cipher_text[8:16]
        cipher_text = cipher_text[16:]
    data = evpKDF(passphrase, salt)
    decrypter = pyaes.Decrypter(pyaes.AESModeOfOperationCBC(data['key'], data['iv']))
    plain_text = decrypter.feed(cipher_text)
    plain_text += decrypter.feed()
    return plain_text
 def _decrypt(self, url):
     import base64
     decrypter = pyaes.Decrypter(
         pyaes.AESModeOfOperationCBC(
             base64.urlsafe_b64decode(
                 'cXdlcnR5dWlvcGFzZGZnaGprbHp4YzEyMzQ1Njc4OTA='),
             '\0' * 16))
     url = base64.decodestring(url)
     url = decrypter.feed(url) + decrypter.feed()
     return url
Exemple #4
0
    def __decrypt(self, ciphertext):
        try:
            ciphertext = base64.b64decode(ciphertext)

            decrypter = pyaes.Decrypter(pyaes.AESModeOfOperationECB(self.key))
            plaintext = decrypter.feed(ciphertext)
            plaintext += decrypter.feed()

            return plaintext

        except Exception:
            return
Exemple #5
0
 def decrypt(self, js):
     js = json.loads(js)
     ciphertext = js["y"]
     iv = js["fast"]
     salt = js["bald"]
     key = I11I1IIII1II11111II1I1I1II11I1I.I11I1IIII1II11111II1I1I1II11III(
         salt)
     iv = iv.decode('hex')
     decrypter = pyaes.Decrypter(pyaes.AESModeOfOperationCBC(key, iv))
     decrypted = decrypter.feed(
         base64.b64decode(ciphertext)) + decrypter.feed()
     return decrypted
    def __decrypt(self, ciphertext):
        try:
            ciphertext = base64.b64decode(ciphertext)

            decrypter = pyaes.Decrypter(pyaes.AESModeOfOperationECB(self.key))
            plaintext = decrypter.feed(ciphertext)
            plaintext += decrypter.feed()

            return plaintext
        except:
            failure = traceback.format_exc()
            log_utils.log('ShowBox - Exception: \n' + str(failure))
            return
Exemple #7
0
 def __decrypt(self, encrypted):
     try:
         encrypted = base64.b64decode(encrypted)
         salt = encrypted[8:16]
         key_iv = self.__bytes_to_key(self.password, salt)
         key = key_iv[:32]
         iv = key_iv[32:]
         decrypter = pyaes.Decrypter(pyaes.AESModeOfOperationCBC(key, iv = iv))
         plaintext = decrypter.feed(encrypted[16:])
         plaintext += decrypter.feed()
         return plaintext
     except Exception:
         return