please create a brute force option in the following script and have the analyze button scan the text content of the files for common patters creating and displaying a formula to be implemented when brute forcing/guessing the decryption keys. 
import os
import tkinter as tk
from tkinter import filedialog, messagebox, ttk
import threading
import itertools
import string
from cryptography.fernet import Fernet


class Crypt14Decryptor:
    def __init__(self, master):
        self.master = master
        master.title("Crypt14 Decryptor with Analysis")

        self.label = tk.Label(master, text="Select .crypt14 files for analysis:")
        self.label.pack()

        self.filepath_entry = tk.Entry(master, width=50)
        self.filepath_entry.pack()

        self.browse_button = tk.Button(master, text="Browse", command=self.browse_files)
        self.browse_button.pack()

        self.analyze_button = tk.Button(master, text="Analyze Files", command=self.analyze_files)
        self.analyze_button.pack()

        self.analysis_result = tk.Label(master, text="", wraplength=400)
        self.analysis_result.pack()

        self.key_label = tk.Label(master, text="Enter decryption key:")
        self.key_label.pack()

        self.key_entry = tk.Entry(master, show='*', width=50)
        self.key_entry.pack()

        self.decrypt_button = tk.Button(master, text="Decrypt Selected File", command=self.start_decrypt)
        self.decrypt_button.pack()

        self.progress = ttk.Progressbar(master, length=200, mode='determinate')
        self.progress.pack()

        self.file_list = []

    def browse_files(self):
        filenames = filedialog.askopenfilenames(filetypes=[("Crypt14 files", "*.crypt14")])
        self.filepath_entry.delete(0, tk.END)
        self.file_list = filenames
        self.filepath_entry.insert(0, ", ".join(os.path.basename(fn) for fn in self.file_list))

    def analyze_files(self):
        if not self.file_list:
            messagebox.showerror("Error", "Please select .crypt14 files for analysis.")
            return

        # Analyze file size and names for insights into pattern or common attributes
        analysis_summary = "File Analysis:\n"
        total_size = 0
        common_patterns = set()

        for filepath in self.file_list:
            file_size = os.path.getsize(filepath)
            total_size += file_size
            filename_root = os.path.splitext(os.path.basename(filepath))[0]
            common_patterns.update(c for c in filename_root if filename_root.count(c) > 1)

        analysis_summary += f"Total Files: {len(self.file_list)}\n"
        analysis_summary += f"Total Size: {total_size} bytes\n"
        analysis_summary += f"Common Patterns in Names: {', '.join(common_patterns) if common_patterns else 'None'}\n"

        self.analysis_result.config(text=analysis_summary)

    def start_decrypt(self):
        selected_key = self.key_entry.get().strip()
        if not selected_key:
            messagebox.showerror("Error", "Please provide a decryption key.")
            return

        if not self.file_list:
            messagebox.showerror("Error", "No files selected to decrypt.")
            return

        if len(selected_key) != 44:
            messagebox.showerror("Error", "Invalid key length. Fernet keys must be 44 characters long.")
            return

        threading.Thread(target=self.decrypt_file, args=(self.file_list[-1], selected_key)).start()

    def decrypt_file(self, filepath, selected_key):
        try:
            key = selected_key.encode()
            with open(filepath, 'rb') as file:
                encrypted_data = file.read()
            
            fernet = Fernet(key)

            # Attempt decryption
            try:
                decrypted_data = fernet.decrypt(encrypted_data)
            except Exception as e:
                messagebox.showerror("Error", f"Decryption failed: {str(e)}")
                return

            output_file = filepath.replace('.crypt14', '.decrypted')
            with open(output_file, 'wb') as file:
                file.write(decrypted_data)

            messagebox.showinfo("Success", f"File decrypted successfully: {output_file}")
        except Exception as e:
            messagebox.showerror("Error", f"An error occurred during decryption: {str(e)}")

if __name__ == "__main__":
    root = tk.Tk()
    decryptor = Crypt14Decryptor(root)
    root.mainloop()