Trouble Remembering Too Many Login Credentials – Password Management with Encryption

This article explains some techniques on how to make your own password manager and convert it into a more secured application with some techniques.

Most of us have 5 to 10 Login IDs and Passwords to be maintained including Facebook, Twitter, LinkedIn, Gmail, Bank Accounts, Workplace login etc. The list would never end and it is difficult to remember every Login Credential. We tend to forget or trouble remembering the password. Other than our Brain’s Memory, we would love to have a safe & secured place to store these credentials.

For this Purpose, You can choose any Password Manager tools available in market after doing a thorough analysis or you can use the techniques explained in this blog.

Secure Your System As well

In reality there is no such thing as 100% Safe when you are connected to Internet. Whatever we encrypt and how hard be it, hackers are definitely smarter than what we are. So, what best can we do?

Let’s give a tough fight as much as we can. We will discuss on best ideas for hiding all our passwords from unauthorized use.

But remember, hiding everything inside a box does not make it a safest place. Use it wise whenever you open it out. Always ensure that the system that you are typing them is secured, else it is like a Rat Hole in Kitchen. Enough Stories Jump on to the Point.

Related: Protecting MS Office Documents with Password using Built In Options.

Encrypt Passwords and Fine Tune

It is easy to store your entire Login Credentials list in Excel and encrypt it by using VBA (A Sample encryption VBA code is presented below).

The worst part is that, most encryption algorithm is reversible and could be cracked. Then how to make a strong Password Manager?

  1. Split your Password into 2 or multiple parts and store only a part of it and hide others in different format. So that, even when you’re Password Manager is cracked, hacker will gain only a part of it.
  2. Fill the excel sheet with Login Ids and passwords (1000s of email ids and passwords) and then insert the original Login Credentials in between. So that after cracking your Excel, hackers will be confused about which one is original.
  3. Make the font of text to match with the background color. So that the excel document when opened will look like empty document.

Related: Changing the Background Color and formatting of Cell with VBA Code.

These are some of the possible different methods that can make our Password Manager into a more secured application.

Enter Login Credentials and Apply Some Basic Encryption

 The below code get list of Login Details along with Password and request user to enter a Master Password. Then, it encrypts all the details entered in the shees1.

This is only a basic encryption method. Users can modify this code to any strong encryption method and implement ideas discussed above in this topic, to make this Password Manager a more secure one.

Private Sub Pwd_Manager_Encrypt()
    'Get Option from User: 1-Encryption or 2-Decryption
    User_Option = InputBox("1-Encryption or 2-Decryption")
    'Get Master Password from User
    Dim User_Master_Password As String
    User_Master_Password = InputBox("Enter Master Password - (Maximum Allowed Password Length 20)")
    'Get Encryption Code for Each Character in Password
    Dim Encrypt_Key(21) As Integer
    For i = 1 To VBA.Len(User_Master_Password)
        TempN = VBA.Asc(VBA.Mid(User_Master_Password, i, 1))
        While TempN > 10
            TempN = Int(Abs(TempN / 10))
        Encrypt_Key(i) = TempN
    Next i
    'Loop Through Each Login Credential and Encrypt It
    For iRow = 1 To 20
        For iCol = 1 To 2
            Output_Text = ""
            Input_Text = ThisWorkbook.Sheets(1).Cells(iRow, iCol)
            Idx_Key = 1
            For iChar = 1 To VBA.Len(Input_Text)
                'Add Encryption Key to Each Input Character
                If User_Option = 1 Then
                    TempN = VBA.Asc(VBA.Mid(Input_Text, iChar, 1)) + Encrypt_Key(Idx_Key)
                End If
                If User_Option = 2 Then
                    TempN = VBA.Asc(VBA.Mid(Input_Text, iChar, 1)) - Encrypt_Key(Idx_Key)
                End If
                'Encrypt or Decrypt and create Output Text
                Output_Text = Output_Text & VBA.Chr(TempN)
                If Idx_Key > VBA.Len(User_Master_Password) Then
                    Idx_Key = 1
                    Idx_Key = Idx_Key + 1
                End If
            Next iChar
            'Write Encrypted Key to Sheet
            'Code here writes output to a different sheet.
            'Once your testing is completed, Write Output to same sheet.
            ThisWorkbook.Sheets(2).Cells(iRow, iCol) = Output_Text
        Next iCol
    Next iRow
End Sub

If your system is already compromised, any stealth mode apps are stealing your key strokes, and then there is no point in using the world’s most secured Password Manager. Google for the related topics on how to use passwords safely while you are in Internet.

Related Posts on Error Handling and Security


Leave a Reply