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)

"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

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

What I Learnt Today : 10 Unknown Amazing Facts About Animals - Part CXXXIII

  image credit (1) Japanese Macaques make snowballs for fun. (2) The chevrotain is an animal that looks like a tiny deer with fangs. (3) Turritopsis nutricula Immortal jellyfish is the only species known to live forever. (4) One million stray dogs and 500,000 stray cats live in New York City metropolitan area. Turritopsis nutricula Immortal jellyfish   image credit (5) Nine-banded armadillos always give birth to identical quadruplets. (6) The flying frog uses flaps of skin between its toes to glide. (7) It takes a sloth two weeks to digest its food.   Nine-banded armadillo   flying frogs   image credit (8) A narwhal tusk is actually an exaggerated front left tooth, and unlike most teeth, it's soft and sensitive on the outside with a tough interior. (9) Humpback whales create the loudest sound of any living creature. (10) The slowest mammal on earth is the tree sloth. It only moves at a speed of 6 feet (1.83 meters) per minute. sloth narwhal tusk   i

One Black & White Photograph Daily for 30 days - Day #25

green yard - behind of my village home Camera : Xiaomi Model : 2014818 Location : Bongaon, West Bengal, India Snap Taken : 14 March 2016 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

Before A Heavy Rainfall

I clicked at the exact time ; after about 5 minutes rain started Location : Dakshineswar, Kolkata Snap taken : 02 August 2016 Camera : Xiaomi ; model - 2014818 Tags : Photography, Nature, Landscape photography, Flowers & Plants photography, Sky,  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

The Real Face Of India - Episode 133

The Real Face Of India - Episode#133 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 : 21 Mar 2018   Camera : SAMSUNG, Model : SM-A310N0 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 , 

Deadliest Ancient Indian Weapons

Today here I introduce some ancient destructive weapons which were used in India during 100 to 700 A.D.   My visit : Collections of ancient Indian weapons, Chennai Museum     10. Bhuj, Or Kirpan (Dagger)   image credit     image credit     image credit This kind of dagger were mostly used in India during duels. These daggers are small in shape & size, 6-10 inches long and 2-4 inches wide. Weight is up to 500 grams. This dagger is made of steel, jade, gold, diamond, emerald, ruby, agate etc. These daggers were not popular in the wars, only popular for hand-to-hand fighting.  09. Valla Or, Shul (Spear)   image credit     image credit     image credit Valla were very popular in the wars, because, attackers could use it in keeping themselves from safe distances. It has a long sharp steel bladed head. Length is up to 40 inches & weight is up to 5 kilograms.  08. Trishul (Triple bladed spear)   image credit     image credit    

mathematics behind chess

Is there any relationship between supposing numerically and supposing in the round of Chess? At the end of the day, should a man having a dynamic personality in Mathematics turned out to be essentially a decent Chess player have aptitudes in Mathematics?  It is important to call attention to that because of the subject intricacy, our endeavors will be to clarify essential attributes of both  Science and Chess which have been postured by surely understood Mathematicians and Chess players. In like manner, we are not keen on uncovering truths, for instance, from the Theory of Knowledge, Psychology, Epistemology or going further into the specialized and complex parts of Chess.  In the first place, let us analyze a few characteristics of Mathernatics.  Individuals having poor involvement in Mathematics trust that knowing how to include, subtract, increase or separation empowers them to say that they could ace Mathematics. Others having some aptitude in performing fa

The Real Face Of India - Episode 118

The Real Face Of India - Episode#118 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 : 22 Jan 2018   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 ,  Epi

Amazing arts by unknown artists - Series #31

I captured all these art photographs in the Kolkata Book Fair, 2018. I tried to know the original artists of these awesome arts, but, failed. Enjoy this awesome arts. All credits goes to the unknown artists :) To Be Continued.. Previous 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 Tags : Art, Drawing, Fine arts, Painting, 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
Back to Top