Skip to main content

An open source strong password generator program for steemians [repost]

In my previous post https://steemit.com/programming/@royalmacro/a-free-open-source-data-encryption-program-for-steemit-users I share a data encrypton tool with source code, now, today here I share another program, a strong password generator with source code.
This program will generate strong, hard-to-guess passwords. I’ll do it by hashing together “domain name”, “login/user id” & “a secure master key”.
If you use the same secure master key for every password generations then you do not need to write down or, memorize your generated passwords. When you need your password then repeat the same procedure to re-generate it. If your “domain name”, “login/user id” & “a secure master key” are not different then you will generate the same password.
If you use only one secure master key then you have to only memorize your master key, not the passwords.
Lets try it !
Step by Step Development :
Open a new project in Visual Basic 8. Select “Standard EXE”.


Create 5 text boxes & one command button. Text1 textbox, Text2 textbox, Text3 textbox, Text4 textbox, Text5 textbox & Command1 commandbutton.
enter image description here
Add 5 Labels with captions “domain name”, “login/user id”, “secure master key”, “strong password” & “normal password”. And change the caption of the Command1 commandbutton to “Generate”. Add the passwordchar “*” to the Text3 textbox “password char” properties.
enter image description here
Add a module “Module 1” to the project
enter image description here
Add this following codes to the module “Module 1” :
enter image description here
Option Explicit

Public Function CryptRC4(sText As String, sKey As String) As String
Dim baS(0 To 255) As Byte
Dim baK(0 To 255) As Byte
Dim bytSwap     As Byte
Dim lI          As Long
Dim lJ          As Long
Dim lIdx        As Long

For lIdx = 0 To 255
    baS(lIdx) = lIdx
    baK(lIdx) = Asc(Mid$(sKey, 1 + (lIdx Mod Len(sKey)), 1))
Next
For lI = 0 To 255
    lJ = (lJ + baS(lI) + baK(lI)) Mod 256
    bytSwap = baS(lI)
    baS(lI) = baS(lJ)
    baS(lJ) = bytSwap
Next
lI = 0
lJ = 0
For lIdx = 1 To Len(sText)
    lI = (lI + 1) Mod 256
    lJ = (lJ + baS(lI)) Mod 256
    bytSwap = baS(lI)
    baS(lI) = baS(lJ)
    baS(lJ) = bytSwap
    CryptRC4 = CryptRC4 & Chr$((pvCryptXor(baS((CLng(baS(lI)) + baS(lJ)) Mod 256), Asc(Mid$(sText, lIdx, 1)))))
Next
End Function

Public Function pvCryptXor(ByVal lI As Long, ByVal lJ As Long) As Long
If lI = lJ Then
    pvCryptXor = lJ
Else
    pvCryptXor = lI Xor lJ
End If
End Function

Public Function ToHexDump(sText As String) As String
Dim lIdx            As Long

For lIdx = 1 To Len(sText)
    ToHexDump = ToHexDump & Right$("0" & Hex(Asc(Mid(sText, lIdx, 1))), 2)
Next
End Function

Public Function FromHexDump(sText As String) As String
Dim lIdx            As Long

For lIdx = 1 To Len(sText) Step 2
    FromHexDump = FromHexDump & Chr$(CLng("&H" & Mid(sText, lIdx, 2)))
Next
End Function
Input this following code to Form1 :
enter image description here
Private Sub Command1_Click()
Dim KEY As String
Dim Password As String
Dim str1, str2, str3, str4, laststr As String

If Me.Text1.Text = "" Then
MsgBox "Error - You have entered no domain!", vbCritical, "Error"
ElseIf Me.Text2.Text = "" Then
MsgBox "Error - You have entered no Login ID!", vbCritical, "Error"
ElseIf Me.Text3.Text = "" Then
MsgBox "Error - You have entered no master key!", vbCritical, "Error"
ElseIf Len(Me.Text3.Text) < 3 Then
MsgBox "Error - You have entered too short Master Key. Please, enter at least 3 characters!", vbCritical, "Error"
Else

KEY = LCase(Me.Text1.Text) + LCase(Me.Text2.Text)

Password = ToHexDump(CryptRC4(Me.Text3.Text, KEY))
If Len(Password) > 18 Then
Password = Mid$(Password, 1, 18)
End If

str1 = Mid$(Password, 1, 1)
str2 = Mid$(Password, 2, 1)
str3 = Mid$(Password, 3, 1)
str4 = Mid$(Password, 4, 1)
laststr = Mid$(Password, 5, Len(Password) - 4)

If Len(Me.Text3.Text) = 3 Then

Me.Text4.Text = str1 + "S" + str2 + "^" + str3 + "7" + str4 + "l" + laststr
Me.Text5.Text = str1 + "t" + str2 + "3" + str3 + "I" + str4 + "0" + laststr

ElseIf Len(Me.Text3.Text) = 4 Then

Me.Text4.Text = str1 + "R" + str2 + "$" + str3 + "8" + str4 + "j" + laststr
Me.Text5.Text = str1 + "k" + str2 + "7" + str3 + "X" + str4 + "5" + laststr

ElseIf Len(Me.Text3.Text) = 5 Then

Me.Text4.Text = str1 + "E" + str2 + "%" + str3 + "6" + str4 + "g" + laststr
Me.Text5.Text = str1 + "d" + str2 + "2" + str3 + "U" + str4 + "4" + laststr

ElseIf Len(Me.Text3.Text) = 6 Then

Me.Text4.Text = str1 + "H" + str2 + "!" + str3 + "5" + str4 + "m" + laststr
Me.Text5.Text = str1 + "v" + str2 + "1" + str3 + "F" + str4 + "0" + laststr

ElseIf Len(Me.Text3.Text) = 7 Then

Me.Text4.Text = str1 + "J" + str2 + "~" + str3 + "6" + str4 + "c" + laststr
Me.Text5.Text = str1 + "w" + str2 + "7" + str3 + "Q" + str4 + "9" + laststr

ElseIf Len(Me.Text3.Text) = 8 Then

Me.Text4.Text = str1 + "Z" + str2 + "#" + str3 + "8" + str4 + "h" + laststr
Me.Text5.Text = str1 + "o" + str2 + "6" + str3 + "T" + str4 + "4" + laststr

ElseIf Len(Me.Text3.Text) = 9 Then

Me.Text4.Text = str1 + "Y" + str2 + "@" + str3 + "5" + str4 + "d" + laststr
Me.Text5.Text = str1 + "p" + str2 + "4" + str3 + "W" + str4 + "7" + laststr

ElseIf Len(Me.Text3.Text) = 10 Then

Me.Text4.Text = str1 + "Z" + str2 + "&" + str3 + "8" + str4 + "n" + laststr
Me.Text5.Text = str1 + "y" + str2 + "2" + str3 + "G" + str4 + "5" + laststr

ElseIf Len(Me.Text3.Text) = 11 Then

Me.Text4.Text = str1 + "B" + str2 + "*" + str3 + "3" + str4 + "j" + laststr
Me.Text5.Text = str1 + "f" + str2 + "0" + str3 + "V" + str4 + "7" + laststr

ElseIf Len(Me.Text3.Text) = 12 Then

Me.Text4.Text = str1 + "Q" + str2 + "(" + str3 + "6" + str4 + "e" + laststr
Me.Text5.Text = str1 + "r" + str2 + "5" + str3 + "W" + str4 + "9" + laststr

ElseIf Len(Me.Text3.Text) = 13 Then

Me.Text4.Text = str1 + "U" + str2 + ")" + str3 + "7" + str4 + "t" + laststr
Me.Text5.Text = str1 + "m" + str2 + "4" + str3 + "K" + str4 + "7" + laststr

ElseIf Len(Me.Text3.Text) = 14 Then

Me.Text4.Text = str1 + "O" + str2 + "-" + str3 + "2" + str4 + "l" + laststr
Me.Text5.Text = str1 + "w" + str2 + "6" + str3 + "I" + str4 + "4" + laststr

ElseIf Len(Me.Text3.Text) = 15 Then

Me.Text4.Text = str1 + "X" + str2 + "=" + str3 + "7" + str4 + "j" + laststr
Me.Text5.Text = str1 + "d" + str2 + "5" + str3 + "V" + str4 + "6" + laststr

ElseIf Len(Me.Text3.Text) = 16 Then

Me.Text4.Text = str1 + "C" + str2 + "+" + str3 + "6" + str4 + "n" + laststr
Me.Text5.Text = str1 + "m" + str2 + "9" + str3 + "J" + str4 + "8" + laststr

ElseIf Len(Me.Text3.Text) > 16 Then

Me.Text4.Text = str1 + "T" + str2 + "+" + str3 + "6" + str4 + "y" + laststr
Me.Text5.Text = str1 + "l" + str2 + "9" + str3 + "X" + str4 + "8" + laststr


End If
End If
End Sub
Make the exe file :
enter image description here
Completed ! Now run the exe file :
enter image description here
In this tutorial I use “gmail.com” as domain, “samplegmailaccount@gmail.com” as login/user id & “12345678” as my secure master key. And after pressing the “Generate” button I got two types of passwords – strong (0Z5#388h834926252CB6) & normal (0o563T84834926252CB6). Look strong type passwords has special characters & normal has not. Some websites don’t support any special characters as password. So, you can normal password there. If you change any fields of domain, login/user id & secure master key then this program will generate quite different password.
If you use only one secure master key to generate your passwords then you have to only memorize your master key, not the passwords. And you will generate different types of strong passwords for different websites or Login/User IDs.
Thank you :D

Tags : Open Source Project, Security, Software, Programming, Steemit, Visual Basic,  

This Post Was Published On My Steemit Blog. Please, navigate to steemit and cast a free upvote to help me if you like my post. First Time heard about Steemit ? Click Here To Know Everything About Steemit 







Comments

Popular Posts (Last 7 Days)

South Africa is participating in largest and most advanced HIV vaccine trial program; makes its own history

image credit A big step for mankind -  South Africa is participating in  HIV  (Human Immunodeficiency Virus) vaccine program. This vaccine could prevent HIV infection. The drug trial began last month. This program is called  HVTN 702 . About 5400 adults are participating in this  HIV  vaccine trial. Scientists say that this  HIV  vaccine program is the largest and most advanced trial program in South Africa.   “If deployed alongside our current armoury of proven HIV prevention tools, a safe and effective vaccine could be the final nail in the coffin for HIV,” said Anthony Fauci, director of the National Institute of Allergy and Infectious Diseases (NIAID), which falls under the American National Institutes of Health (NIH), a co-funder of the trial.   “Even a moderately effective vaccine would significantly decrease the burden of HIV disease over time in countries and populations with high rates of HIV infection, such as South Africa.”  image credit Dr Glenda Gray  is

"royalmacro" trail short update - Auto Upvote List

Today I just included a few steemians in my auto upvote list -- All posts of the following accounts must be auto upvoted by the trail after 30 minutes of publishing @gyanibilli @gamerveda @arnob @indiantraveller @nadira @libert @mindfreak @sujoy1990 @chotto @jznsamuel @munmunbiswas  [Plz activate on trail] @leohira123 @ragini00 @simaroy @atkins @drsupriya18 @jimmyrai28  [Plz activate on trail] @ronald0 @jerremie @jsantana @blacks  [Plz activate on trail] @artists @steemmeets @firepower @pharesim @steampty @rahul.stan @looftee @richman @vaibhavshah @terrycraft @slowwalker @trafalgar @ericvancewalton @papa-pepper @gavvet @benjojo @crowdfundedwhale @curie @abdullar @jlufer  [Plz activate on trail] @mgibson @funnyman  [Plz activate on trail] @elyaque  [Plz activate on trail] However, some users are delisted now but, they must be listed in the near future if they enable their account on trail. I request now the following members to enab

One day at the Zoo -Episode #20

Two weeks ago I visited "Alipore Zoological Gardens" in Kolkata which is mostly known as "Alipore Zoo". It was founded in the year of 1875 in British India. And it was established by Edward VII, and then The prince of wales. This zoo is the biggest attraction of the tourists in the "City of Joy". However, the Alipore Zoo has some notable historical value as it's the most old zoological garden in India. The zoo was also famous for the home of "Aldabra giant tortoise". But, in 2006 the tortoise died at the age of almost 250. There are now over 1266 animals of 108 species are living in the Alipore Zoo. And annual visitors of the zoo is about 3 millions. **I captured some photos, but, due to the obstacle of the fence I couldn't take them very clearly. * Saltwater Crocodile To be continued ... Episode #1 ,  Episode #2 ,  Episode #3 ,  Episode#4 ,  Episode#5 ,  Episode#6 ,  Episode#7 ,  Episode#8 ,  Episode#9 ,  Episode

The Real Face Of India - Episode 79

The Real Face Of India - Episode#79 I believe that India is the most beautiful country in the world. In this series I show the real face of beautiful India. Half Dozen Photos of Natural Beauties Snap taken : 31 Aug 2017   Camera : SONY, Model : DSC-W710 Other Episodes :  Episode#01 ,  Episode#02 ,  Episode#03 ,  Episode#04 ,  Episode#05 ,  Episode#06 ,  Episode#07 ,  Episode#08 ,  Episode#09 ,  Episode#10 ,  Episode#11 ,  Episode#12 ,  Episode#13 ,  Episode#14 ,  Episode#15 ,  Episode#16 ,  Episode#17 ,  Episode#18 ,  Episode#19 ,  Episode#20 ,  Episode#21 ,  Episode#22 ,  Episode#23 ,  Episode#24 ,  Episode#25 ,  Episode#26 ,  Episode#27 ,  Episode#28 ,  Episode#29 ,  Episode#30 ,  Episode#31 ,  Episode#32 ,  Episode#33 ,  Episode#34 ,  Episode#35 ,  Episode#36 ,  Episode#37 ,  Episode#38 ,  Episode#39 ,  Episode#40 ,  Episode#41 ,  Episode#42 ,  Episode#43 ,  Episode#44 ,  Episode#45 ,  Episode#46 ,  Episode#47 ,  Episode#48 ,  Episode#49 ,  Episode#50 ,  Epis

Buds

I captured this photo when I was travelling a rural jungle... Tags : Photography, Nature, Macro Photography, Flowers & Plants photography,  This Post Was Published On My Steemit Blog . Please, navigate to steemit and cast a free upvote to help me if you like my post. First Time heard about Steemit ? Click Here To Know Everything About Steemit  $3 Donation [Fixed] Donate $Any Amount

One day at the Zoo -Episode #22

Two weeks ago I visited "Alipore Zoological Gardens" in Kolkata which is mostly known as "Alipore Zoo". It was founded in the year of 1875 in British India. And it was established by Edward VII, and then The prince of wales. This zoo is the biggest attraction of the tourists in the "City of Joy". However, the Alipore Zoo has some notable historical value as it's the most old zoological garden in India. The zoo was also famous for the home of "Aldabra giant tortoise". But, in 2006 the tortoise died at the age of almost 250. There are now over 1266 animals of 108 species are living in the Alipore Zoo. And annual visitors of the zoo is about 3 millions. **I captured some photos, but, due to the obstacle of the fence I couldn't take them very clearly. * Gharial To be continued ... Episode #1 ,  Episode #2 ,  Episode #3 ,  Episode#4 ,  Episode#5 ,  Episode#6 ,  Episode#7 ,  Episode#8 ,  Episode#9 ,  Episode#10 ,  Episode#1

Seven Day - Black & White Challenge: [Day #05]

Seven day black & white challenge: [Day #05] Some simple rules must be obeyed to be eligible in this contest • Seven black and white images that represent an aspect of your life. • Present one image every day for seven days. • No people. • No explanation. • Nominate someone every day, but anyone can join the fun. • Use the tag -  #sevendaybnwchallenge  - as one of your five tags. My Today's Nomination :  @photoman Tags : Black & White Photography, Flowers & Plants photography, Landscape photography, Nature, Photography,  This Post Was Published On My Steemit Blog . Please, navigate to steemit and cast a free upvote to help me if you like my post. First Time heard about Steemit ? Click Here To Know Everything About Steemit  $3 Donation [Fixed] Donate $Any Amount

Blue Moon

Tags : Photography, Nature, Moon This Post Was Published On My Steemit Blog . Please, navigate to steemit and cast a free upvote to help me if you like my post. First Time heard about Steemit ? Click Here To Know Everything About Steemit  $3 Donation [Fixed] Donate $Any Amount

Macro Photography - Cobweb

Macro-shot of Cobweb Tags : Photography, Macro Photography, Nature,  This Post Was Published On My Steemit Blog . Please, navigate to steemit and cast a free upvote to help me if you like my post. First Time heard about Steemit ? Click Here To Know Everything About Steemit  $3 Donation [Fixed] Donate $Any Amount

Macro Photography - Buds

A macro shot of Buds Tags : Photography, Macro Photography, Flowers & Plants photography, Nature,  This Post Was Published On My Steemit Blog . Please, navigate to steemit and cast a free upvote to help me if you like my post. First Time heard about Steemit ? Click Here To Know Everything About Steemit  $3 Donation [Fixed] Donate $Any Amount
Back to Top