Password Generator and Manager using Python

Published on . Written by

Password Generator and Manager using Python

In today’s age every website or application we encounter, we need to sign-up with our credentials. There is no problem in filling name, email-id, contact number, and other stuff but when it comes to entering a password everyone really stuck and start to think about which password to use. Most of the people use common passwords like “abc12345” or “name@123” which are very easy to guess. There is another group of peoples who use a single password for every signup, but be aware! Because if a hacker gets that single password then you will be really in very trouble.

Read more..

SLNOTE

Skyfi Labs Projects
But don’t worry, Python has a solution for it also.

In this project, we are going to create a python script that will ask for the account name and generate the random password for it. Not only this, but it also stores that password for the corresponding account.

Project Description

The concept of this password generator project is very simple. We want to generate a random password every time when we create a new account and store it for future reference in our machine.

In this python project, we will ask the user to enter the account name for which he wants to create a password. Then the script will generate the unique password for that account name and instead of printing, it will be copied to clipboard. The project also includes the provision to store the password of storing the password associated with the account name so that it can be accessed whenever needed.

Modules used in this Project:


SLLATEST
Random: Basically, random is used to generate a pseudo-random number for various distributions. For integers, it uniformly selects from a given range. For sequence there, it uniformly selects random elements, a function to generate a random permutation of a list in place, and a function for random sampling without replacement. In our project, we mainly focus on random.sample(list, k ). It returns the list of k unique elements chosen from the list.  It is mainly used for random sampling without replacement.

Pickle: Pickle module is used for serializing and deserializing a Python object structure. ‘Pickling’ is a process whereby a Python object hierarchy is converted into a byte stream and ‘unpickling’ is reverse of it.  We implement pickle.load(file) to read a string from open file object and interpreting it as a pickle data stream. Another method we used is pickle.dump(obj,[protocol]) which returns the pickled representation of an object as a string, instead of writing it to file. The protocol is given 0 by default.

pyperclip: Motive behind using this module is to copy the password generated to the clipboard using pyperclip.copy() method.

Project Implementation

The steps needed to follow to complete this project are:

  • We will create a string with all small, capital letters and numbers and special symbols. A random generator will pick the random characters to form it.
  • Ask the user to enter the length of the password and account name for which to generate the password.
  • Using random, generate the password and store it in the dictionary with key as account name and value as a password.
  • Then using pickle, write that dictionary to a ‘password.pass’ file (You can give any extension) in binary format.
  • Then copy the generated password using pyperclip and use it.
  • In order to retrieve the password stored in the file, it will ask for the account name and the password will be copied to the clipboard.
Software requirements: Text editor and Python3

Programming Language: Python


SLDYK
Kit required to develop Password Generator and Manager using Python:
Technologies you will learn by working on Password Generator and Manager using Python:


Any Questions?


Subscribe for more project ideas