Esempio n. 1
0
    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()))
Esempio n. 2
0
    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()))
Esempio n. 3
0
 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()))
Esempio n. 4
0
 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()))