# Decrypts the data, requires a user-input password Print('Please enter the password and press the enter key \n Decryption may take some time') encode('utf8')Į = open('file.enc','wb') # file.enc doesn't need to exist, python will create it Применение: with open(in_filename, 'rb') as in_file, open(out_filename, 'wb') as out_file: Key, iv = derive_key_and_iv(password, salt, key_length, bs)Ĭhunk, next_chunk = next_chunk, crypt(in_file.read(1024 * bs)) Return d, dĭef decrypt(in_file, out_file, password, key_length=32):