Featured
- Get link
- X
- Other Apps
Python Passoword Generator
This is a program written in python, the purpose of the program is to make you password stronger. It has a simple GUI for you to input a key word and desired password strength, and it will provide you with a secure password using that key word. It can also return the hashed value of the new password.
You can download the program from my Github:
https://github.com/windyGarlic/password-generator
from tkinter import *
import random
from passlib.hash import pbkdf2_sha256
class main():
secLevel = []
passwd = ""
# password generator
def submit():
password = entry.get()
charList = ['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', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P',
'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '!', '@', '#', '$', '%']
iconList = ['!', '@', '#', '$', '%']
# generator loop
for char in main.secLevel:
p = random.choice(iconList)
p += password
password = p
password += str(random.randint(1, 9))
password += random.choice(charList)
text = StringVar()
text.set(password)
password += random.choice(iconList)
main.passwd = pbkdf2_sha256.hash(password)
# result
myEntry = Entry(window, bd=0,
font=("Arial", 12),
state="readonly",
textvariable=text)
myEntry.pack()
# level of security
def order():
if x.get() == 0:
main.secLevel = []
elif x.get() == 1:
main.secLevel = [1, 2]
elif x.get() == 2:
main.secLevel = [1, 2, 3]
elif x.get() == 3:
main.secLevel = [1, 2, 3, 4, 5, 6]
else:
print("huh?")
def Hash():
text2 = StringVar()
text2.set(main.passwd)
myEntry2 = Entry(window, bd=0,
font=("Arial", 12),
state="readonly",
textvariable=text2)
myEntry2.pack()
# start window
window = Tk()
window.title("Password Generator")
label = Label(window, text="Type the keyword you'd like \nto make a password.", font=('Times New Roman', 18))
label.pack()
entry = Entry(window,
font=('Times New Roman', 20),
fg='black')
entry.pack(anchor=W)
submitButton = Button(window, text="Submit", command=submit)
submitButton.pack(anchor=N)
- Get link
- X
- Other Apps
Comments
Post a Comment