How To Secure Your Passwords In Python



 In this post we are going to create a Python Application which will help you to secure your passwords. So let's get started.

So we are going to replace a bunch of characters to symbol like !, @, #, $, %, ^, &, *             ,(, ) ….   So our basics idea is, we will take password input from the user then we will replace a few character with symbol and then we will output that new password.

Here is the code.



SECURE = (('s', '$'), ('and', '&'), 
            ('a', '@'), ('o', '0'), ('i', '1'),
            ('I', '|'))

def securePassword(password):
    for a,b in SECURE:
        password = password.replace(a, b)
    return password

if __name__ == "__main__":
    password = input("Enter your password\n")
    password = securePassword(password)
    print(f"Your secure password is {password}")

Post a Comment

Previous Post Next Post