enotkrutoy commited on
Commit
26da11f
1 Parent(s): 5e0ca0f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -3
app.py CHANGED
@@ -14,7 +14,16 @@ def crack_password(password_hash, wordlist_file, algorithm, salt, parallel, comp
14
  Cracker.crack_passwords_with_brute_force(min_length, max_length, character_set)
15
  else:
16
  Cracker.crack_passwords_with_wordlist()
17
- return Cracker.get_statistics()
 
 
 
 
 
 
 
 
 
18
 
19
  def main():
20
  st.title("GVA Password Cracker")
@@ -32,6 +41,10 @@ def main():
32
  brute_force = st.sidebar.checkbox("Perform Brute Force Attack")
33
 
34
  if st.sidebar.button("Crack Password"):
 
 
 
 
35
  cracking_spinner = st.spinner("Cracking...")
36
  with cracking_spinner:
37
  stats = crack_password(
@@ -46,8 +59,8 @@ def main():
46
  character_set=character_set,
47
  brute_force=brute_force
48
  )
49
- st.success(f"Password Cracked! {stats}")
50
  st.balloons()
51
 
52
  if __name__ == "__main__":
53
- main()
 
14
  Cracker.crack_passwords_with_brute_force(min_length, max_length, character_set)
15
  else:
16
  Cracker.crack_passwords_with_wordlist()
17
+
18
+ # Получаем статистику
19
+ stats = Cracker.get_statistics()
20
+
21
+ # Преобразуем статистику в строку для отображения в Streamlit
22
+ stats_str = f"Total Attempts: {stats.get('total_attempts', 'N/A')}\n"
23
+ stats_str += f"Cracked Password: {stats.get('cracked_password', 'N/A')}\n"
24
+ stats_str += f"Time Taken: {stats.get('time_taken', 'N/A')}\n"
25
+
26
+ return stats_str
27
 
28
  def main():
29
  st.title("GVA Password Cracker")
 
41
  brute_force = st.sidebar.checkbox("Perform Brute Force Attack")
42
 
43
  if st.sidebar.button("Crack Password"):
44
+ if not wordlist_file:
45
+ st.error("Please upload a wordlist file.")
46
+ return
47
+
48
  cracking_spinner = st.spinner("Cracking...")
49
  with cracking_spinner:
50
  stats = crack_password(
 
59
  character_set=character_set,
60
  brute_force=brute_force
61
  )
62
+ st.success(f"Password Cracked! Statistics data:\n{stats}")
63
  st.balloons()
64
 
65
  if __name__ == "__main__":
66
+ main()