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)

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

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

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] ...

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. slot...

Newslink : Some Technology News Links [Episode 1]

Georgia Tech Researchers Succeed in Creating Permanent 4D Printed Objects   image credit :  the merkle Whereas the vast majority of the world is focused on 3D printing, some  scientists and engineers are looking at the fourth dimension. Georgia  Tech is one of the first institutions to allow for shapeshifting 3D  printing. This technology is known as 4D printing, as it allows objects  to change shape once it comes off the printing bed. An intriguing  development, especially when considering how objects can transform  through the use of heat. 4D Printing Will Be The Next Frontier While 3D  printing is quite appealing to a lot of consumers, not all of the prints  come out the way creators Read More   Inmates Hide Self-Built Computers and Abuse Staff Credentials to Surf the Web   image credit :  the merkle Prison staff in Ohio came across a rather interesting discovery  recently. As it turns out, two inma...

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 ,  Episod...

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

an unknown bird singing on my friend's window Camera : SAMSUNG Model : GT-I8262 Location : Bongaon, West Bengal, India Snap Taken : 23 february 2015 Tags : Black & White Photography, Photography, Birds, Birds 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

Monkey, Tree & Temple

Just Outside The Dakshineswar Kali Temple Location : Dakshineswar, Kolkata Snap taken : 02 August 2016 Camera : Xiaomi ; model - 2014818 Tags : Photography, Animals photography, Wildlife photography, Building & Architecture, Flowers & Plants photography, Nature, Landscape 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

Sunset in village

Sunset in village Tags :   India, Landscape photography, Nature, Photography, Sunset, Village, Sky This Post Was Published On My Steemit Blog .  Earned : $00.00 SBD Converted to USD @1.41$ Rate = $00.00 USD .  First Time heard about Steemit ? Click Here To Know...

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

image credit (1) The world’s smallest dog was a Yorkshire Terrier, which weighed just four ounces. (2) Snakes are carnivores, which means they only eat animals, often small ones such as insects, birds, frogs and other small mammals. (3) Owning a cat can reduce the risk of stroke and heart attack by a third. (4) Male gentoo and Adelie penguins “propose” to females by giving them a pebble.   Penguins   image credit (5) You can tell a turtle’s gender by the noise it makes. Males grunt, females hiss. (6) Every Dolphin has its own unique dorsal fin. It’s similar to human’s fingerprints. (7) Oysters can change gender depending on which is best for mating. Turtle   image credit (8) The red panda uses its long bushy tail not only for balance, but also as a blanket during chilly winter nights. (9) Dogs have an excellent eye-vision during night than humans. (10) Elephants don’t drink through their trunks like a straw. Red Panda   image credit ...
Back to Top