Add files via upload

This commit is contained in:
Alfa
2018-05-23 17:02:40 -05:00
committed by GitHub
parent 74ec8311e6
commit 117b8979c3
2 changed files with 9 additions and 5 deletions

View File

@@ -169,7 +169,7 @@ class Client(object):
#decryptor = aes.AESModeOfOperationCBC(key, iv='\0' * 16)
except:
import jscrypto
decryptor = jscrypto.new(key, AES.MODE_CBC, '\0' * 16)
decryptor = jscrypto.new(key, jscrypto.MODE_CBC, '\0' * 16)
return decryptor.decrypt(data)
def aes_cbc_decrypt_a32(self,data, key):

View File

@@ -1,6 +1,4 @@
import urllib2
from Crypto.Cipher import AES
from Crypto.Util import Counter
class Cursor(object):
def __init__(self, file):
@@ -61,8 +59,14 @@ class Cursor(object):
def prepare_decoder(self,offset):
initial_value = self.initial_value + int(offset/16)
self.decryptor = AES.new(self._file._client.a32_to_str(self.k), AES.MODE_CTR, counter = Counter.new(128, initial_value = initial_value))
#self.decryptor = aes.AESModeOfOperationCTR(f=self,key=self._client.a32_to_str(self.k),counter=aes.Counter(initial_value=initial_value))
try:
from Crypto.Cipher import AES
from Crypto.Util import Counter
self.decryptor = AES.new(self._file._client.a32_to_str(self.k), AES.MODE_CTR, counter = Counter.new(128, initial_value = initial_value))
except:
from pyaes import aes
self.decryptor = aes.AESModeOfOperationCTR(f=self,key=self._client.a32_to_str(self.k),counter=aes.Counter(initial_value=initial_value))
rest = offset - int(offset/16)*16
if rest:
self.decode(str(0)*rest)