Know the master key yourself. Do not try to do this.
Use py-bcrypt (bcrypt), a powerful hash method to generate a password yourself.
Basically you can do it (idea ...)
import bcrypt from getpass import getpass master_secret_key = getpass('tell me the master secret key you are going to use') salt = bcrypt.gensalt() combo_password = raw_password + salt + master_secret_key hashed_password = bcrypt.hashpw(combo_password, salt)
save the salt and hash the password somewhere, so whenever you need to use a password, you read the encrypted password and check the original password that you enter again.
This is basically how login should work these days.
CppLearner Aug 21 2018-12-12T00: 00Z
source share