import string
from random import *
try:
import numpy
from numpy import random
HAS_NUMPY = True
except ImportError:
HAS_NUMPY = False
import numpy as np
import passlib
from passlib.context import CryptContext
pwd_context = CryptContext(
schemes = ["pbkdf2_sha256"],
default = "pbkdf2_sha256",
pbkdf2_sha256__default_rounds=3000
)
ce = '''🅲 🅸 🅿 🅷 🅴 🆁 🅴 🅽 🅲 🆁 🆈 🅿 🆃 🅸 🅾 🅽
℃ i̲p̲h̲e̲r̲ €n̲c̲r̲y̲p̲t̲i̲o̲n̲ cͨiͥрⷬhͪeͤrͬeͤncͨrͬyрⷬᴛⷮiͥoͦn'''
print(ce)
characters = string.ascii_letters + string.punctuation + string.digits
autopwd = "".join(choice(characters) for x in range(randint(8, 16)))
print (f"Here is your auto generated password: {autopwd}!\n")
print("Welcome to the Encrypted Python Password Generator!\nThe following matrix grid displays your available choices to be made!\n\n")
letters =
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+']
pwd_matrix = np.array(letters + numbers + symbols)
print(pwd_matrix)
user_choice =
input("Do you want an easy password or an encrypted complex password?\n\n Press 'E' or 'e' for easy,'H' or 'h' for hard or 'B' or 'b' for both!")
if user_choice != "E":
if user_choice!="e":
if user_choice != "H":
if user_choice != "h":
if user_choice != "B":
if user_choice !="b":
print("You must enter proper values!")
user_choice =
input("Do you want an easy password or an encrypted complex password?\n\n Press 'E' or 'e' for easy, or 'H' or 'h' for hard.\n")
else:
print("Ookie Dookie, baking")
user_letters = int(input("How many letters would you like to include with your password?\n\n"))
user_symbols = int(input("How many symbols would you like to include with your password?\n\n"))
user_numbers = int(input("How many numbers would you like to include with your password?\n\n"))
standard_pwd = []
def standardGenerator():
for char in range(1,user_letters + 1):
standard_pwd.append(random.choice(letters))
for char in range(1, user_symbols + 1):
standard_pwd.append(random.choice(symbols))
for char in range(1, user_numbers + 1):
standard_pwd.append(random.choice(numbers))
std_pwd = ""
for char in standard_pwd:
std_pwd += char
std_pwd.lower
print(f"Your standard password is: \n{std_pwd}\n\nEnjoy!\n")
pwd_list = []
def complexGenerator():
for char in range(1, user_letters + 1):
pwd_list.append(random.choice(letters))
for char in range(1, user_symbols + 1):
pwd_list.append(random.choice(symbols))
for char in range(1, user_numbers + 1):
pwd_list.append(random.choice(numbers))
print(f"Your complex password is: {complex_pwd}\n\nEnjoy!")
pwd_list = []
for char in range(1, user_letters + 1):
pwd_list.append(random.choice(letters))
for char in range(1, user_symbols + 1):
pwd_list += random.choice(symbols)
for char in range(1, user_numbers + 1):
pwd_list += random.choice(numbers)
random.shuffle(pwd_list)
complex_pwd = ""
for char in pwd_list:
complex_pwd += char
if user_choice == "e" or user_choice == "E": # easy generator
standardGenerator()
elif user_choice == "h" or user_choice == "H": # hard generator
complexGenerator()
elif user_choice == "b" or user_choice == "B":
standardGenerator()
complexGenerator()
else:
print("Please enter an e or a h or a b!")
def encrypt_password(password):
return pwd_context.CryptContext.hash(password)
def check_encrypted_password(password, hashed):
return pwd_context.CryptContext.hash(password)