Skip to main content

A strong password generator program with source code

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, Programming, Security, Software, 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 



$3 Donation [Fixed]

$Any Amount





Comments

Popular Posts (Last 7 Days)

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


Steemit bug found in “TAG”

Steemit bug found in “TAG”
image credit I just found a serious bug on steemit TAG. Today I published a news cum TIL post with 5 tags -
wilt news newslink til steemitnews https://steemit.com/wilt/@royalmacro/what-i-learnt-today-darkweb-raises-funds-for-assassinating-both-donald-trump-and-mike-pence But, my post is visible in only one section in “wilt”. Other tags are not working anymore. I searched frequently in the following sections which I tagged – https://steemit.com/created/newshttps://steemit.com/created/newslinkhttps://steemit.com/created/tilhttps://steemit.com/created/steemitnews My post is invisible in the above sections. It’s only visible in -
https://steemit.com/created/wilt
Update : I just found a solution. I used 4 tags instead of 5. Now, my post is visible to all 4 sections. Tags : Blockchain, Bugs, Cryptocurrency, Steemit,  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 Steem…

My Original Abstract Art - "fence of flower"

My Original Abstract Art  "fence of flower"
enjoy :) 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 



"Share It with Steemit" should be a great idea

I believe sharing photos, arts, musics, videos, news, articles etc. of other people's works from different sources has also value. And also important for steemit community. You must follow some guidelines to make this kind of sharing post - Don't spamming. Do not share random contents from web. Only share what you love most.Do not copy paste directly from source.There are two ways to share: (i) Write your own words, make a summarization, highlight vital portions to make it attractive & finally cite the original source and name of author. (ii) Write your own words in only title & then copy-paste some portion from original article, link it to the source.Always cite the name of original content writer & original source.If you want to use images then you need include the image sources also.You may use tags for this post : shareit/shareitsteemit/share-it/share-it-steemit/siws/sis Here I give some examples [I follow type (i) here -I wrote my own words & made a summar…

Life without modern gadgets

We can't think about a day without electronic gadgets. The day starts with a computerized wake up timer and "advanced" goes with us for the duration of the day – wherever we go and whatever we do. 




These electronic contraptions have officially left a tremendous effect on our way of life; individuals of any age are utilizing diverse sorts of devices. It is presently for all intents and purposes difficult to live without these things; figuring out how schedule to keeping up all contacts, every one of our exercises are controlled by contraptions and thingamabobs. 
PDAs lie at the focal point of our life; updates, to-do's, contacts, messages – everything can be followed with a most recent mobile phone set. Music mates can purchase a cell telephone with great sound quality, radio and enough memory to store melodies. iPods are likewise very mainstream among music significant others nowadays. 
iPhones and iPads are two most recent advancements that have gigantic potential. …

Close Shot - Red Chili (Chili pepper)

Red Chili is one kind of fruit of plants from the genus Capsicum and species Frutescens. So, it's scientific name is Capsicum Frutescens. They are vastly used in all kinds of bengali curry and spicy dishes. They are also used in many cuisines to add spiciness to dishes. Nutrition Facts [per 100 gm]
Total Calories 35
Fat 0%
Cholesterol 0%
Sodium 0%
Potassium 10%
Carbohydrate 2%
Dietary fiber 6%
Sugar 0%
Protein 3%
Vitamin A 19%
Vitamin B-6 25%
Vitamin C 240%
Iron 5%
Magnesium 5%
Calcium 1%
[Source of Nutrition info : wikipedia] Location : Barasat, Kolkata, West Bengal
Snap taken : 14 March 2018
Camera : samsung; model - SM-A310N0 Tags : Photography, Nature, Fruits, Fruits photography, Macro 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


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 fast estimations think the…

Top 10 famous Abstract Art of all the time

Top 10 famous Abstract Art of all the time I love abstract arts. I believe that abstract art is not what you see , it’s what you think. Abstract art is the freedom of using colors, is the freedom of representing your thoughts in colors. Today, here I share top 10 famous abstract arts of all the time. Hope you’ll enjoy them. Number 10 : The Son Of Man by Rene Magritte
image source & credit : LINK Artist: René Magritte
Media: Oil paint
Created: 1964
Period: Surrealism
Subject: René Magritte Number 09 : Garçon à la pipe by Pablo Picasso
image source & credit : LINK Artist: Pablo Picasso
Dimensions: 1 m x 81 cm
Created: 1905
Media: Oil paint
Period: Picasso’s Rose Period
Support: Canvas Number 08 : The Night Watch by Rembrandt
image source & credit : LINK Artist: Rembrandt
Dimensions: 3.63 m x 4.37 m
Created: 1642
Locations: Amsterdam Museum, Rijksmuseum
Periods: Baroque, Dutch Golden Age
Genres: Portrait, History painting Number 07 : Girl with a pearl earring by Johannes Ver…

mathematics behind football

Next time you are watching football and you see your most loved quarterback toss a pass finish, consider the math utilized as a part of association with finished pass. Math is utilized as a part of expert football in each work on, preparing camp, pre-season amusement, and standard season diversion. Without math it would simply be a diversion that utilizations pigskin. 
We should take a gander at the finished pass and the math included. The quarterback is followed by the rate of culminations endeavored and made, alongside finishing yards. The separation he tossed the ball and which side of the field he through the ball. Also, to the culmination rate taking into account taking the snap from under focus or shotgun. These pigskin numbers are all used to build up a numerical model of the quarterback, for factual examination with different quarterbacks.  The recipient who got the pass is judged on the quantity of passes tossed to him and the quantity of gets. He is likewise judged on the n…

My Stereogram Collections - Part 1

what can you see ? reply in post ...
what can you see ? reply in post ...

what can you see ? reply in post ... Tags :Funny, Images, Stereogram This Post Was Published On My Steemit Blog
Earned : $33.86 SBD Converted to USD @1.41$ Rate = $47.7426 USD
First Time heard about Steemit ? Click Here To Know...

Back to Top