7 Is your password secure?

 

This chapter covers

  • Checking if an input matches a value
  • Creating and using for loops
  • Using elif not to check and respond to a condition
  • Using any() to return an outcome based on any individual letter in a password meeting a condition

Did you know that it takes a supercomputer less than one second to crack a seven-character password that contains only lowercase letters! In contrast, it takes nearly 200 years to crack a 12-character password made up of lower- and uppercase letters. However, most systems limit the number of times that you can enter an incorrect password before the system locks you out. This means that even though it takes less than one second to crack a weak password, on the third attempt the system would lock out the user.

Since passwords are used everywhere for protecting data and keeping information safe and secret, it is essential that your passwords are secure.

If you want a secure password that is easy to remember but hard to guess, then the password should meet at least the following criteria:

  1. At least eight characters in length. (Special characters can be included for more security and we will explore this later on)
  2. Contains at least one uppercase letter.
  3. Contains at least one lowercase letter.
  4. Contains at least one number (known as a digit).

Creating the project

Creating a new file

Importing the modules

Creating the variables

Creating the password check function

Checking strings

Building the main app

Running and testing the GUI

Other things to try

Increasing the length check of the password

Adding a button to clear the password

Closing the GUI

Checking the password for special characters

Summary