passwords

How do I update the password?

How do I update the password? Question: I am working on a web app and I want a user to be able to reset their password but I’m failing to do so how can I do it? I also tried email = request.form.get(’email’) new_password = request.form.get(‘password’) user = User.query.filter_by(email=email).first() If user : user.password = new_password. …

Total answers: 1

Is there a way to make my code more effiecient

Is there a way to make my code more effiecient Question: Hey so I’m a beginner and was just trying out projects to get better so I made a password checker. Just want to see if there is anyway I can make my code neater or more efficient to tips are nice. import re regex …

Total answers: 4

Simple password validator using regex

Simple password validator using regex Question: As my first Python project, I am trying to create a program that will have you enter a password and check if it meets the requirements using regex. The password I used, "Apples20!", prompted the program to say that I was missing a special character, even though I have …

Total answers: 1

How to shuffle strings in python

How to shuffle strings in python Question: I am trying to make a password generator project but I don’t know how to shuffle the password. Here is my code: #Password Generator Project import random letters = [‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’, ‘h’, ‘i’, ‘j’, ‘k’, ‘l’, ‘m’, ‘n’, ‘o’, ‘p’, ‘q’, ‘r’, ‘s’, …

Total answers: 2

Regex validate string contains letters and numbers regardless of special characters

Regex validate string contains letters and numbers regardless of special characters Question: For password validation in Python, I need to make a regex, which validates that passwords contains both letters and numbers. I have this regex: re.match(r"^[A-Za-z]+d+.*$", password) But if the password contains a special character, then it won’t pass. So password for example "MyPassword6" …

Total answers: 3

Verifying username and password input through flask python

Verifying username and password input through flask python Question: My project requires I read and write input username and password to a text file (not db or json). From there when the user logs in, I need to verify that the username and password match. I have encrypted the password using sha256. Every time I …

Total answers: 1

How to permanently save a variable (login information)

How to permanently save a variable (login information) Question: I am trying to code a username and password system and was wondering if there was any way to save the variable so even when the code stops the username will work the next time. I have not yet started coding it and was just wondering …

Total answers: 3

How to hide/show password with Custom Tkinter?

How to hide/show password with Custom Tkinter? Question: Can’t find any info about how to make password visible or hide with Custom Tkinter. import tkinter as tk import customtkinter def toggle_password(): if txt.cget(‘show’) == ”: txt.config(show=’*’) else: txt.config(show=”) root = tk.Tk() root.geometry("200×200") txt = customtkinter.CTkEntry(root, width=20) txt.pack() toggle_btn = customtkinter.CTkButton(root, text=’Show Password’, width=15, command=toggle_password) toggle_btn.pack() …

Total answers: 2

Proper data encryption with a user-set password in python3

Proper data encryption with a user-set password in python3 Question: I have been looking for a proper data encryption library in python for a long while, today I needed it once again, cannot find anything, so is there any way to encrypt data using a user-set password, if I find something it’s usually insecure, if …

Total answers: 3

for loop for password add letters in django

for loop for password add letters in django Question: so i want to check if my password less from key_bytes (which is 16) then the password will be add "0" until it’s have len 16. i was using django. for example password = katakataka. it’s only 10. then it will became "katakataka000000" i don’t know …

Total answers: 4