Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Jigsy1 authored Jan 31, 2023
1 parent addebc4 commit 24e043f
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 34 deletions.
Binary file modified PassGen.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions PassGen.vbp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Type=Exe
Form=frmPassGen.frm
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\WINXP\system32\stdole2.tlb#OLE Automation
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\WINXP\system32\stdole2.tlb#OLE Automation
Form=frmSpecial.frm
Form=frmOverride.frm
Form=frmAbout.frm
Expand All @@ -15,7 +15,7 @@ HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=2
RevisionVer=0
RevisionVer=1
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="Jigsy"
Expand Down
7 changes: 7 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v1.2.1:
----------
I realized that I incremented the version number incorrectly after the last version. Sadly, I'm now stuck with it. Now with that out of the way...

1. Added an option to avoid using space on the first and last characters in the password.
2. Added a simple "Help" MsgBox which lists the hotkeys that can be used.

v1.2.0:
----------
1. Fixed a very minor glitch.
Expand Down
98 changes: 66 additions & 32 deletions frmPassGen.frm
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,75 @@ VERSION 5.00
Begin VB.Form frmPassGen
BorderStyle = 1 'Fixed Single
Caption = "Password Generator"
ClientHeight = 4200
ClientHeight = 4560
ClientLeft = 45
ClientTop = 615
ClientWidth = 12000
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4200
ScaleHeight = 4560
ScaleWidth = 12000
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton cmdSelect
Caption = "Se&lect All"
Height = 375
Left = 2040
TabIndex = 13
Top = 3720
TabIndex = 14
Top = 4080
Width = 1335
End
Begin VB.Timer tmrAutomatic
Enabled = 0 'False
Interval = 60000
Left = 9960
Top = 3720
Top = 4080
End
Begin VB.Timer tmrNoteClear
Enabled = 0 'False
Interval = 2000
Left = 9480
Top = 3720
Top = 4080
End
Begin VB.CommandButton cmdClose
Caption = "&Close"
Height = 375
Left = 10560
TabIndex = 16
Top = 3720
TabIndex = 17
Top = 4080
Width = 1335
End
Begin VB.CommandButton cmdCopy
Caption = "C&opy"
Height = 375
Left = 3480
TabIndex = 14
Top = 3720
TabIndex = 15
Top = 4080
Width = 1335
End
Begin VB.CommandButton cmdGenerate
Caption = "&Generate (F5)"
Height = 375
Left = 120
TabIndex = 12
Top = 3720
TabIndex = 13
Top = 4080
Width = 1335
End
Begin VB.Frame fmeString
Caption = "Extra:"
Height = 1935
Height = 2295
Left = 120
TabIndex = 18
TabIndex = 19
Top = 1680
Width = 3855
Begin VB.CheckBox chkAvoidSpace
Caption = "Avoid using space on the first/last character(s)"
Height = 255
Left = 120
TabIndex = 10
Top = 1550
Width = 3615
End
Begin VB.CheckBox chkNoRep
Caption = "Avoid using the same character in succession"
Height = 255
Expand All @@ -77,17 +85,17 @@ Begin VB.Form frmPassGen
Left = 2760
List = "frmPassGen.frx":0019
Style = 2 'Dropdown List
TabIndex = 11
Top = 1520
TabIndex = 12
Top = 1875
Width = 975
End
Begin VB.CheckBox chkPIM
Caption = "Include a random PIM from 1 to "
Height = 255
Left = 120
TabIndex = 10
TabIndex = 11
ToolTipText = "Note: For when making VeraCrypt file(s)/volume(s)"
Top = 1560
Top = 1920
Width = 3615
End
Begin VB.CheckBox chkAutomatic
Expand Down Expand Up @@ -118,32 +126,32 @@ Begin VB.Form frmPassGen
Caption = "That are a length of characters"
Height = 255
Left = 120
TabIndex = 20
TabIndex = 21
Top = 640
Width = 3615
End
Begin VB.Label lblNumber
Caption = "Generate a total of password(s)"
Height = 255
Left = 120
TabIndex = 19
TabIndex = 20
Top = 280
Width = 3615
End
End
Begin VB.ListBox lstPasswords
Height = 3570
Height = 3960
Left = 4080
MultiSelect = 2 'Extended
TabIndex = 15
TabIndex = 16
Top = 0
Width = 7815
End
Begin VB.Frame fmeSettings
Caption = "Include:"
Height = 1575
Left = 120
TabIndex = 17
TabIndex = 18
Top = 0
Width = 3855
Begin VB.CommandButton cmdSpecial
Expand Down Expand Up @@ -237,6 +245,13 @@ Begin VB.Form frmPassGen
Shortcut = ^W
End
End
Begin VB.Menu menuHelp
Caption = "&Help"
Begin VB.Menu menuHotkeys
Caption = "Hot&keys"
Shortcut = ^H
End
End
End
Attribute VB_Name = "frmPassGen"
Attribute VB_GlobalNameSpace = False
Expand Down Expand Up @@ -319,7 +334,7 @@ Public Function addLenNumbers()
Next lengthNumber
cmbLength.AddItem "Rand"
cmbLength.Text = IIf(IsNull(cmbLength.Tag) = False And cmbLength.Tag <> "", cmbLength.Tag, 16)
' `-> The minimum is eight, but nobody should really be using sub 16 character passwords in 2022.
' `-> The minimum is eight, but nobody should really be using sub 16 character passwords in 2022 onwards.
End Function

Private Function resetTimer()
Expand All @@ -342,12 +357,15 @@ Private Function makePass(passCount As Integer, inputLength As Variant)
isRand = 0
If inputLength = "Rand" Then isRand = 1
lstPasswords.Clear
Dim lastChar As String, makeNumber As Integer, newChar As String, outString As String, randNumber As Integer
Dim lastChar As String, makeNumber As Integer, newChar As String, outString As String, randNumber As Integer, skipFlag As Integer
skipFlag = 0
' `-> For skipping spaces on first and last.
For makeNumber = 0 To passCount - 1
outString = ""
Dim lengthNumber As Integer
If isRand = 1 Then inputLength = Int(Val(minPassLen + Val(Rnd * Val(maxPassLen - Val(minPassLen - 1)))))
For lengthNumber = 0 To inputLength - 1
If skipFlag = 1 Then skipFlag = 0
If moreRandomness = 1 Then
randNumber = Int(Val(1 + Val(Rnd * 6)))
Select Case randNumber
Expand All @@ -371,21 +389,31 @@ Private Function makePass(passCount As Integer, inputLength As Variant)
Else
newChar = Mid(baseString, Int(Val(1 + Val(Rnd * Len(baseString)))), 1)
End If
If chkNoRep.Value = 1 Then
If lastChar <> "" Then
If lastChar = newChar Then
' `-> Do it again.
If chkAvoidSpace.Value = 1 Then
If lengthNumber = 0 Or lengthNumber = inputLength - 1 Then
If newChar = " " Then
lengthNumber = lengthNumber - 1
skipFlag = 1
End If
End If
End If
If skipFlag = 0 Then
If chkNoRep.Value = 1 Then
If lastChar <> "" Then
If lastChar = newChar Then
' `-> Do it again.
lengthNumber = lengthNumber - 1
Else
outString = outString & newChar
lastChar = newChar
End If
Else
outString = outString & newChar
lastChar = newChar
End If
Else
outString = outString & newChar
lastChar = newChar
End If
Else
outString = outString & newChar
End If
Next lengthNumber
If chkPIM.Value = 1 Then
Expand Down Expand Up @@ -488,6 +516,7 @@ Public Function saveToRegistry()
qS.RegWrite ourPath & "passLength", cmbLength.Text, "REG_SZ"
qS.RegWrite ourPath & "useAutomatic", chkAutomatic.Value, "REG_DWORD"
qS.RegWrite ourPath & "useNoRepeat", chkNoRep.Value, "REG_DWORD"
qS.RegWrite ourPath & "useAvoidSpaces", chkAvoidSpace.Value, "REG_DWORD"
qS.RegWrite ourPath & "usePIM", chkPIM.Value, "REG_DWORD"
qS.RegWrite ourPath & "PIM", cmbPIM.Text, "REG_DWORD"
' ,-> Special(s).
Expand Down Expand Up @@ -766,6 +795,7 @@ Private Sub Form_Load()
End If
If isRegKey(ourPath & "useAutomatic") = True Then chkAutomatic.Value = isBool(qS.RegRead(ourPath & "useAutomatic"))
If isRegKey(ourPath & "useNoRepeat") = True Then chkNoRep.Value = isBool(qS.RegRead(ourPath & "useNoRepeat"))
If isRegKey(ourPath & "useAvoidSpaces") = True Then chkAvoidSpace.Value = isBool(qS.RegRead(ourPath & "useAvoidSpaces"))
If isRegKey(ourPath & "usePIM") = True Then chkPIM.Value = isBool(qS.RegRead(ourPath & "usePIM"))
If isRegKey(ourPath & "PIM") = True Then
If IsNumeric(qS.RegRead(ourPath & "PIM")) = True Then
Expand Down Expand Up @@ -798,6 +828,10 @@ Private Sub menuExit_Click()
End
End Sub

Private Sub menuHotkeys_Click()
MsgBox "F5 - Generate (new) password(s)" & vbNewLine & "Del - Clear the password list" & vbNewLine & vbNewLine & "Esc - Close (sub)forms or end program", vbInformation, "Hotkeys"
End Sub

Private Sub menuOverride_Click()
frmOverride.Visible = True
End Sub
Expand Down
92 changes: 92 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
PassGen v1.1.0.1 by Jigsy (https://github.com/Jigsy1) released under The Unlicense.

Compatible with:
* Windows 98 SE (requires MSVBVM60.dll)
* Windows ME
* Windows XP
* Windows 8.1

Assumed compatibility with:
* Windows Vista
* Windows 7
* Windows 8
* Windows 10
* Windows 11

Not compatible with:
* Windows 3.1 (assumed)
* Windows 95 (assumed)
* WINE <=1.8
* Unsure about other versions >1.8

How to use:
---------------
Simply run the PassGen.exe file.

Upon loading you will be presented with a form that includes certain options such as characters to include, number of passwords, etc.

The default options for passwords are to include Uppercase characters, Lowercase characters, Numbers and Special characters.
For a total of 64 passwords, each 16 characters long.


To generate a list of password(s), simply press "Generate." (Or press F5.)
You can generate a minimum of 1 password, and a maximum of 1,024.

If you wish to clear the list from prying eyes, press "Del." (Located next to the Ins key at the top of the keyboard.)


Clicking the [?] next to "Include Special characters..." will bring up a form allowing you to choose what special characters you
want to include.
Deselecting all of them will disable special characters until you choose at least one character.
There is a button to include everything if you've deselected everything prior.

You can also access this from the menubar. (CTRL+I)


Password length is limited from 8 to 64 characters. However, you can override this by selecting from the Menubar->Settings->Override. (Or pressing CTRL+O.)
This will bring up a form which allows you to increase password length to 128 characters, 256 or 512 characters.

There is also a drop down option for "Rand" characters, which will generate passwords of random length from 8 to <the maximum set>.


Also under the override form is an option to increase the randomness of the passwords generated if you do not feel the current randomness
is sufficient.


Another three options on the main form are "Automatically generate new password(s) (60s)" which is pretty self-explainatory,
"Avoid using the same characters in succession," which will prevent things like, for example, ABBA (in which B follows B) and,
"Include a random PIM from 1 to <N>."
If you're a user of VeraCrypt, you can include a random number (a PIM) after your password for use in file(s) or volumes(s).
This will appear as: <password> ------------ <N>

Note: If the pasword is less than 20 characters, and the PIM drop down is either set as 128 or 256, this will not appear.
This is due to the fact that the default PIM in VeraCrypt is 485 - unless sha512 or Whirlpool are selected, in which case it is 98.
For those who do use sha512/Whirlpool, there is an override option to drop the default PIM to 92.

If you wish to copy a password to the clipboard, simply select the password in the list and press "Copy."
If you wish to copy all the passwords, press "Select All," which will automatically select everything for you, then press copy.

Note: Windows 8.1 has an issue copying a large number of large passwords to the clipboard, an issue which didn't occur on Windows XP. (Or 98 SE!)
If this happens, you will be told that you failed to copy to the clipboard. The only fallback option I can suggest is copying a certain amount at
a time.

If you were successful in copying to the clipboard, the titlebar will change briefly.


If you wish to save your settings for next time click the "Save Settings to Registry on Exit" option in the menubar (under Settings), then close the application.
To clear the settings, simply click the same option again.


Note: If this fails to work, open regedit, then delete the following key: HKCU\Software\Github\Jigsy1\PassGen\



Bug(s)/Etc.:
---------------
If you find a bug, please feel free to open an issue on Github.

If it's (not) compatible with a version of Windows/WINE, please let me know by opening an issue on Github.



-Jigsy

0 comments on commit 24e043f

Please sign in to comment.