Canstralian commited on
Commit
70bb8bf
·
verified ·
1 Parent(s): 6ca0072

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -15
app.py CHANGED
@@ -3,12 +3,11 @@ import pandas as pd
3
  import numpy as np
4
  import matplotlib.pyplot as plt
5
  import seaborn as sns
6
- from wordlist_generator import generate_wordlist # A mock-up function for your project
7
  from dotenv import load_dotenv
8
  import os
9
 
10
- # Load environment variables from .env file
11
- load_dotenv()
12
  access_token = os.getenv("HUGGINGFACE_ACCESS_TOKEN")
13
 
14
  # Page configuration
@@ -42,21 +41,18 @@ include_numbers = st.sidebar.checkbox("Include Numbers", value=True)
42
  # Display wordlist generation results
43
  st.header("Generated Wordlist Preview")
44
 
45
- # Call to a mock-up function for wordlist generation (you will replace this with your actual logic)
46
- try:
47
- wordlist = generate_wordlist(
48
- size=wordlist_size,
49
- min_length=min_length,
50
- max_length=max_length,
51
- special_chars=include_special_chars,
52
- numbers=include_numbers
53
- )
54
- except Exception as e:
55
- st.error(f"Error generating wordlist: {e}")
56
 
57
  # Display the first 20 items in the wordlist
58
  st.write(f"Preview of {wordlist_size} words:")
59
- st.dataframe(pd.DataFrame(wordlist[:20], columns=["Generated Words"])) # Display as a table for better interaction
60
 
61
  # Download link for the full wordlist
62
  st.markdown("### Download Full Wordlist")
@@ -103,6 +99,11 @@ if entropy < 50:
103
  else:
104
  st.success("Good entropy! This wordlist is secure against most brute-force attempts.")
105
 
 
 
 
 
 
106
  # Footer
107
  st.markdown("---")
108
  st.markdown(
 
3
  import numpy as np
4
  import matplotlib.pyplot as plt
5
  import seaborn as sns
6
+ from wordlist_generator import generate_wordlist # Assuming your generate_wordlist function is imported here
7
  from dotenv import load_dotenv
8
  import os
9
 
10
+ load_dotenv() # Load environment variables from .env file
 
11
  access_token = os.getenv("HUGGINGFACE_ACCESS_TOKEN")
12
 
13
  # Page configuration
 
41
  # Display wordlist generation results
42
  st.header("Generated Wordlist Preview")
43
 
44
+ # Call to the actual logic for wordlist generation
45
+ wordlist = generate_wordlist(
46
+ size=wordlist_size,
47
+ min_length=min_length,
48
+ max_length=max_length,
49
+ special_chars=include_special_chars,
50
+ numbers=include_numbers
51
+ )
 
 
 
52
 
53
  # Display the first 20 items in the wordlist
54
  st.write(f"Preview of {wordlist_size} words:")
55
+ st.write(wordlist[:20]) # Show the first 20 words for brevity
56
 
57
  # Download link for the full wordlist
58
  st.markdown("### Download Full Wordlist")
 
99
  else:
100
  st.success("Good entropy! This wordlist is secure against most brute-force attempts.")
101
 
102
+ # Additional Analysis (Average Word Length)
103
+ st.header("Additional Analysis: Average Word Length")
104
+ avg_word_length = np.mean(word_lengths)
105
+ st.write(f"Average Word Length: {avg_word_length:.2f} characters")
106
+
107
  # Footer
108
  st.markdown("---")
109
  st.markdown(