Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hashlib
- import tkinter as tk
- from tkinter import ttk, filedialog, scrolledtext
- import threading
- from datetime import datetime
- import os
- class HashingApp:
- def __init__(self, root):
- self.root = root
- self.root.title("CyberHash - Advanced SHA384 Toolkit")
- self.root.geometry("1000x700")
- self.root.configure(bg='#1a1a1a')
- # Variables
- self.input_file = None
- self.is_processing = False
- self.setup_gui()
- self.show_welcome_message()
- def setup_gui(self):
- # Main container
- main_frame = tk.Frame(self.root, bg='#1a1a1a')
- main_frame.pack(fill=tk.BOTH, expand=True, padx=20, pady=20)
- # Title
- title_frame = tk.Frame(main_frame, bg='#1a1a1a')
- title_frame.pack(fill=tk.X, pady=(0,20))
- title_label = tk.Label(
- title_frame,
- text="CyberHash Toolkit",
- font=("Helvetica", 24, "bold"),
- fg='#00ff00',
- bg='#1a1a1a'
- )
- title_label.pack()
- subtitle_label = tk.Label(
- title_frame,
- text="Advanced SHA384 Hash Generator",
- font=("Helvetica", 12),
- fg='#00ff00',
- bg='#1a1a1a'
- )
- subtitle_label.pack()
- # Control Panel
- control_frame = tk.LabelFrame(
- main_frame,
- text="Control Panel",
- fg='#00ff00',
- bg='#1a1a1a',
- font=("Helvetica", 10, "bold")
- )
- control_frame.pack(fill=tk.X, pady=(0,20))
- # File Selection
- self.file_frame = tk.Frame(control_frame, bg='#1a1a1a')
- self.file_frame.pack(fill=tk.X, padx=20, pady=10)
- self.select_btn = tk.Button(
- self.file_frame,
- text="Select Wordlist",
- command=self.select_file,
- bg='#333333',
- fg='#00ff00',
- font=("Helvetica", 10),
- relief=tk.GROOVE
- )
- self.select_btn.pack(side=tk.LEFT)
- self.file_label = tk.Label(
- self.file_frame,
- text="No file selected",
- fg='#999999',
- bg='#1a1a1a',
- font=("Helvetica", 10)
- )
- self.file_label.pack(side=tk.LEFT, padx=10)
- # Output Options
- output_frame = tk.Frame(control_frame, bg='#1a1a1a')
- output_frame.pack(fill=tk.X, padx=20, pady=10)
- tk.Label(
- output_frame,
- text="Output file:",
- fg='#00ff00',
- bg='#1a1a1a'
- ).pack(side=tk.LEFT)
- self.output_entry = tk.Entry(
- output_frame,
- bg='#333333',
- fg='#00ff00',
- insertbackground='#00ff00'
- )
- self.output_entry.pack(side=tk.LEFT, padx=10, fill=tk.X, expand=True)
- # Progress Bar
- self.progress_frame = tk.Frame(control_frame, bg='#1a1a1a')
- self.progress_frame.pack(fill=tk.X, padx=20, pady=10)
- self.progress_bar = ttk.Progressbar(
- self.progress_frame,
- orient='horizontal',
- mode='determinate',
- length=300
- )
- self.progress_bar.pack(fill=tk.X)
- self.progress_label = tk.Label(
- self.progress_frame,
- text="Ready",
- fg='#00ff00',
- bg='#1a1a1a'
- )
- self.progress_label.pack()
- # Buttons
- button_frame = tk.Frame(control_frame, bg='#1a1a1a')
- button_frame.pack(fill=tk.X, padx=20, pady=10)
- self.start_btn = tk.Button(
- button_frame,
- text="Start Hashing",
- command=self.start_hashing,
- bg='#333333',
- fg='#00ff00',
- font=("Helvetica", 10, "bold"),
- relief=tk.GROOVE,
- state=tk.DISABLED
- )
- self.start_btn.pack(side=tk.LEFT)
- self.clear_btn = tk.Button(
- button_frame,
- text="Clear Log",
- command=self.clear_log,
- bg='#333333',
- fg='#00ff00',
- font=("Helvetica", 10),
- relief=tk.GROOVE
- )
- self.clear_btn.pack(side=tk.LEFT, padx=10)
- # Terminal Output
- terminal_frame = tk.LabelFrame(
- main_frame,
- text="Terminal Output",
- fg='#00ff00',
- bg='#1a1a1a',
- font=("Helvetica", 10, "bold")
- )
- terminal_frame.pack(fill=tk.BOTH, expand=True)
- self.terminal = scrolledtext.ScrolledText(
- terminal_frame,
- bg='#000000',
- fg='#00ff00',
- font=("Consolas", 10),
- wrap=tk.WORD
- )
- self.terminal.pack(fill=tk.BOTH, expand=True, padx=10, pady=10)
- self.terminal.tag_config("cyan", foreground="#00ffff")
- self.terminal.tag_config("green", foreground="#00ff00")
- self.terminal.tag_config("yellow", foreground="#ffff00")
- self.terminal.tag_config("red", foreground="#ff0000")
- def show_welcome_message(self):
- welcome_msg = """
- ╔══════════════════════════════════════════════════════════════╗
- ║ CYBERHASH TOOLKIT v2.0 ║
- ║--------------------------------------------------------------║
- ║ [*] Advanced SHA384 Hash Generator ║
- ║ [*] Developed by: Security Research Team ║
- ║ [*] Started at: {time} ║
- ║ ║
- ║ Usage: ║
- ║ 1. Select your wordlist file ║
- ║ 2. Specify output filename ║
- ║ 3. Click 'Start Hashing' to begin ║
- ╚══════════════════════════════════════════════════════════════╝
- """.format(time=datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
- self.log(welcome_msg, "cyan")
- def log(self, message, color="white"):
- self.terminal.insert(tk.END, message + "\n", color)
- self.terminal.see(tk.END)
- def select_file(self):
- filename = filedialog.askopenfilename(
- title="Select Wordlist",
- filetypes=[("Text Files", "*.txt"), ("All Files", "*.*")]
- )
- if filename:
- self.input_file = filename
- self.file_label.config(text =os.path.basename(filename))
- self.start_btn.config(state=tk.NORMAL)
- self.log(f"[+] Selected wordlist: {filename}", "green")
- def clear_log(self):
- self.terminal.delete(1.0, tk.END)
- self.show_welcome_message()
- def start_hashing(self):
- if not self.input_file:
- self.log("[!] Please select a wordlist first", "red")
- return
- output_file = self.output_entry.get().strip()
- if not output_file:
- self.log("[!] Please specify output filename", "red")
- return
- if self.is_processing:
- self.log("[ !] Hashing is already in progress", "yellow")
- return
- self.is_processing = True
- self.log("[+] Hashing started", "green")
- threading.Thread(target=self.hash_files, args=(self.input_file, output_file)).start()
- def hash_files(self, input_file, output_file):
- try:
- with open(input_file, "r") as f:
- lines = f.readlines()
- total_lines = len(lines)
- self.progress_bar.config(maximum=total_lines)
- with open(output_file, "w") as f:
- for i, line in enumerate(lines):
- line = line.strip()
- if line:
- hashed = hashlib.sha384(line.encode()).hexdigest()
- f.write(f"{line}:{hashed}\n")
- self.log(f"Hashing {line} -> {hashed}", "cyan")
- # Update progress setiap line
- self.progress_bar["value"] = i + 1
- self.progress_label.config(text=f"Hashing {i+1}/{total_lines}...")
- self.root.update_idletasks()
- # Pastikan progress bar penuh di akhir
- self.progress_bar["value"] = total_lines
- self.log(f"[+] Hashing completed: {output_file}", "green")
- # Ubah label menjadi "Finished" ketika selesai
- self.progress_label.config(text="Finished")
- except Exception as e:
- self.log(f"[!] Error: {str(e)}", "red")
- self.progress_label.config(text="Error")
- finally:
- self.is_processing = False
- if __name__ == "__main__":
- root = tk.Tk()
- app = HashingApp(root)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement