# WARNING: 100 million passwords will take ~10-30GB disk space and hours to generate. # For demo, we'll just show preview. Uncomment the line below only if you have space. # numeric_gen.save_to_file("8digit_numeric.txt", show_progress=True)
# 3. Small demo: 4-digit numeric (10,000 combinations) - safe for testing print("\n=== Demo: 4-digit numeric wordlist (saving to file) ===") demo_gen = PasswordWordlistGenerator(length=4, charset="0123456789") demo_gen.save_to_file("4digit_demo.txt", show_progress=True)
# 2. 8-character lowercase alphanumeric (36^8 = ~2.8 trillion) - too large for disk print("\n=== Alphanumeric (lowercase + digits) ===") alnum_gen = PasswordWordlistGenerator(length=8, charset="abcdefghijklmnopqrstuvwxyz0123456789") print(f"Total combinations: alnum_gen.total_combinations:, (too large for practical saving)")
def preview(self, num: int = 10): """Preview first N passwords.""" print(f"First num passwords (length self.length, charset 'self.charset'):") for i, pwd in enumerate(self.generate()): if i >= num: break print(f" pwd") print(f"Total combinations: self.total_combinations:,") if name == " main ": # 1. Standard 8-digit numeric wordlist (10^8 = 100 million passwords) print("=== 8-Digit Numeric Wordlist ===") numeric_gen = PasswordWordlistGenerator(length=8, charset="0123456789") numeric_gen.preview(10)
def generate(self) -> Iterator[str]: """Generator yielding each password one by one (memory efficient).""" for combo in itertools.product(self.charset, repeat=self.length): yield ''.join(combo)