How Creating Own Password Manager Can Ease Your Pain.

Codeityweb
4 min readJan 7, 2021

Creating Your Own Secure Password Manager

Their are many Password Manager available but in this post we will create our own offline password manager in python.

And I personally use this application for storing my passwords.

We all uses different applications and websites everyday and it requires us to login ,some of them give us option to login using OAuth and we can signup and login using it.

But in many cases we have to register using our Email Id and set a password for our account.

We have to make sure the Password is not common so that it cannot be guessed using dictionary attack.

Also the Length of the password should not be small and must include various letters, digits and punctuation marks to make it difficult to crack.

Much like this Yije4"*{|\/zm+Rgye`.QL>:M^`=&)8_O

We can create few difficult passwords like them, that are hard to crack but we cannot use them on all sites ,because if password of one website is compromised than the websites using the same passwords may also be in danger.

So we need to create almost different passwords for every website with more or less difficulty.

We have a Random Password Generator Post

where we have created a password generator using python which includes letters , digits and punctuation marks and they are almost hard to crack, but how do we remember them?.

So for That we are going to Create A Secure Offline Password Manager of our own to store those passwords and we can use them when they are needed.

So lets Start:

You might have heard that passwords should be hashed and then stored. Because getting the original password is impossible from the hashed passwords.

The Question is:

How to implement password storage with hashing and salting in our application?

For this we will use python hashlib library and we will use sha512 to hash our password.

So What should be the functionality of our app,basically it should perform CRUD operations. Right?

So the main functionality of our app will be :

  1. Store the passwords
  2. Display the passwords to the user
  3. Update the existing record of a website
  4. Delete a particular record

We will not use a simple file or something but we will be using Sqlite3 database for storing our passwords .

Enter User Input
Take Choice from User

This is how it will look like

Step 1:

As we have decided to use sqlite3 database so we need to create a database and tables into it,but wait a minute!

Before Starting it we have some questions like

How many tables do we need?

What will be number of columns in the tables?

In technical terms What will be the fields of the tables? And so on..

So How many Tables do we need?

The answer is we will require only one table to store our passwords

as per our use case.

You can further increase the number of tables to make the app more functional.

if you require but to keep it simple and to make an app that we can use instantly we will make only one table.

Now What will be number of columns in the tables?

So we need Website Name, Username, Password, and also Email Id used for that website.Their are 4 columns in total, again you can increase as per requirements.

Step 2:

Now we have decided how our database will look like, now we have to think of the flow our app .

So we need a master username and master password ,so that only the user can access the database and no one else,and user needs to remember only the master credentials to get all the information.

You may have a question , that is password manager safe?

The answer is simple , yes it is safe because it is standalone offline application that only you will use on your local machine with local database,so no one have access to the details except you☺

Flow Of The App
Flow Of The App

This is the normal flow of our app.

Step 3:

Now lets start to build our app as per the flow.

so we start with getting master user credentials and storing them into the database by hashing the password.

Click Below to Get Full Code:

Thank You For Reading!

--

--

Codeityweb

A Website To Learn Coding,Get Mini Projects With Implementations ,Competitive Programming ,HackerRank Solutions.@ https://codeityweb.blogspot.com