diff --git a/Sources/pyOpenRPA/Tools/SafeSource/Crypter.py b/Sources/pyOpenRPA/Tools/SafeSource/Crypter.py index 62705ef2..6a44c717 100644 --- a/Sources/pyOpenRPA/Tools/SafeSource/Crypter.py +++ b/Sources/pyOpenRPA/Tools/SafeSource/Crypter.py @@ -34,7 +34,6 @@ def encrypt_file(key, in_filename, out_filename=None, chunksize=64*1024): outfile.write(iv) while True: chunk = infile.read(chunksize) - print(chunk) if len(chunk) == 0: break elif len(chunk) % 16 != 0: @@ -61,4 +60,23 @@ def decrypt_file(key, in_filename, out_filename=None, chunksize=24*1024): if len(chunk) == 0: break outfile.write(decryptor.decrypt(chunk)) - outfile.truncate(origsize) \ No newline at end of file + outfile.truncate(origsize) +def decrypt_file_bytes(key, in_filename, chunksize=24*1024): + """ Расшифровывает файл, используя AES (режим CBC) с + заданным ключом. + """ + lResult = b'' + if not out_filename: + out_filename = os.path.splitext(in_filename)[0] + with open(in_filename, 'rb') as infile: + origsize = struct.unpack('