def aes_decrypt(self,key, chunksize=64*1024): self.out_filename = self.out_filename or os.path.splitext(self.in_filename)[0] aes = AesKey(key) with open(self.in_filename, 'rb') as infile: with open(self.out_filename, 'wb') as outfile: outfile.write(aes.decrypt_raw(infile.read()))
def aes_decrypt(self, key, chunksize=64 * 1024): self.out_filename = self.out_filename or os.path.splitext( self.in_filename)[0] aes = AesKey(key) with open(self.in_filename, 'rb') as infile: with open(self.out_filename, 'wb') as outfile: outfile.write(aes.decrypt_raw(infile.read()))
def aes_encrypt(self, key=None, chunksize=64 * 1024): self.out_filename = self.out_filename or self.in_filename + '.enc' aes = AesKey(key) with open(self.in_filename, 'rb') as infile: with open(self.out_filename, 'wb') as outfile: outfile.write(aes.encrypt_raw(infile.read()))
def aes_encrypt(self,key=None, chunksize=64*1024): self.out_filename = self.out_filename or self.in_filename+'.enc' aes = AesKey(key) with open(self.in_filename, 'rb') as infile: with open(self.out_filename, 'wb') as outfile: outfile.write(aes.encrypt_raw(infile.read()))