somdcomputerguy

Another password generator..

3 posts in this topic

This script doesn't actually generate passwords though, it get's them from these websites.

Diceware Passphrase Home

Password Generator - Generate random & secure passwords online

Password Generator - Axantum Software AB

GRC | Ultra High Security Password Generator

In order to generate the Diceware words, these two files need to be downloaded and saved in @scriptdir.

complete list

alternative list

These two files need to be saved with their respective names, diceware.wordlist.asc and beale.wordlist.asc.

Also numbers are gotten from this website to generate the Diceware words.

RANDOM.ORG - True Random Number Service

I have used this script more than once, so I thought to post it here. Hopefully someone will benefit from the script itself, or the coding.

#include <file.au3>
#include <INet.au3>
#include <String.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <GUISysLink.au3>
#include <GUIStatusBar.au3>

Opt('MustDeclareVars', 1)

Local $sLabel1, $sLabel2, $sLabel3, $sLabel4, $sLabel7, $sLabel8 _
    , $sPass1, $sPass2, $sPass3, $sPass4 _
    , $sButton1, $sButton2, $sButton3, $sButton4, $sButton5 _
    , $Awordlist, $Bwordlist _
    , $c, $d, $e, $i, $msg _
    , $output, $aPass1, $aPass2, $aPass3 _
    , $StatusBar, $Form

$Form = GUICreate("Passwords", 950, 350, 45, 330)
$StatusBar = _GUICtrlStatusBar_Create($Form)

$sLabel1 = GUICtrlCreateLabel("DiceWare", 10, 10, 75, 20)
$sPass1  = GUICtrlCreateInput("", 15, 35, 915, 25, $ES_CENTER)
$sButton1 = GUICtrlCreateButton("Refresh", 90, 10, 60, 20)

$sLabel2 = GUICtrlCreateLabel("Random Password Generator", 570, 100, 275, 20)
$sPass2  = GUICtrlCreateInput("", 575, 128, 165, 25, $ES_CENTER)
$sButton2 = GUICtrlCreateButton("Refresh", 750, 130, 60, 20)

$sLabel3 = GUICtrlCreateLabel("Axantum Password Generator", 570, 190, 275, 20)
$sPass3  = GUICtrlCreateInput("", 575, 154, 165, 25, $ES_CENTER)
$sButton3 = GUICtrlCreateButton("Refresh", 750, 160, 60, 20)

$sLabel4 = GUICtrlCreateLabel("GRC's Ultra High Security Password Generator", 10, 95, 285, 25)
$sPass4  = GUICtrlCreateEdit("", 15, 125, 550, 60, $ES_CENTER)
$sButton4 = GUICtrlCreateButton("Refresh", 350, 95, 60, 20)

$sLabel7 = GUICtrlCreateLabel("Number of selected chars - 0", 10, 260, 420, 25)
$sLabel8 = GUICtrlCreateInput("$sLabel8 - just a blank text field to paste password parts into", 25, 225, 875, 25, $ES_CENTER)
$sButton5 = GUICtrlCreateButton("Restart", 450, 265, 60, 20)

GUISetState()

Diceware()
genpass()
Passwords4me()
GRC()

AdlibRegister("SelectedCount")

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            GUIDelete()
            Exit
        Case $msg = $sButton1
            Diceware()
        Case $msg = $sButton2
            genpass()
        Case $msg = $sButton3
            Passwords4me()
        Case $msg = $sButton4
            GRC()
        Case $msg = $sButton5
            Restart()
    EndSelect
WEnd

Func SelectedCount()
    Local $sText = ControlCommand("Passwords", "", ControlGetFocus("Passwords"), "GetSelected", "")
    If $sText <> "" Then
        ;GUICtrlSetData($sLabel1, "Number of selected chars - " & StringLen(StringStripWS($sText, 8)))
        GUICtrlSetData($sLabel7, "Number of selected chars - " & StringLen($sText))
    Else
        GUICtrlSetData($sLabel7, "Number of selected chars - 0")
    EndIf
EndFunc

Func Diceware()
    _FileReadToArray("diceware.wordlist.asc", $Awordlist)
    _FileReadToArray("beale.wordlist.asc", $Bwordlist)
    GUICtrlSetData($sPass1, ' ')
    $output = ''
    For $a = 1 To 7 ;Random(5, 18, 1)
        For $b = 1 to 5
            If $b > 1 Then
                $c &= Random(1, 6, 1)
            Else
                $c = Random(1, 6, 1)
            EndIf
        Next
        $e = StringStripWS(_INetGetSource('https://www.random.org/integers/?num=5&min=1&max=6&col=5&base=10&format=plain&rnd=new') ,8)
        For $x = 1 to $Awordlist[0]
            If StringLeft($Awordlist[$x], 5) = $c And StringLeft($Bwordlist[$x], 5) = $c Then
                $output = $output & StringStripWS(StringTrimLeft($Awordlist[$x], 5), 8) & ' ' & StringStripWS(StringTrimLeft($Bwordlist[$x], 5), 8) & ' '
            EndIf
            If StringLeft($Awordlist[$x], 5) = $e And StringLeft($Bwordlist[$x], 5) = $e Then
                $output = $output & StringStripWS(StringTrimLeft($Awordlist[$x], 5), 8) & ' ' & StringStripWS(StringTrimLeft($Bwordlist[$x], 5), 8) & ' '
            EndIf
        Next
    Next
    GUICtrlSetData($sPass1, $output)
EndFunc

Func genpass()
    $aPass1 = _StringBetween(_INetGetSource('http://www.generate-password.com'), 'value="', '" onclick="')
    GUICtrlSetData($sPass2, "")
    GUICtrlSetData($sPass2, $aPass1[0] & ' ' & $aPass1[1])
EndFunc

Func Passwords4me()
    $aPass2 = _StringBetween(_INetGetSource('http://passwords4me.com/Passwords4me.aspx'), '<input name="ctl00$ContentPlaceHolderXecretsMasterMain$TextBoxStrong" type="text" value="', '" readonly="readonly" id="ctl00_ContentPlaceHolderXecretsMasterMain_TextBoxStrong" class="xecrets-passwords" />')
    GUICtrlSetData($sPass3, "")
    GUICtrlSetData($sPass3, $aPass2[0])
EndFunc

Func GRC()
    $aPass3 = _StringBetween(_INetGetSource('https://www.grc.com/passwords.htm'), '<font color="black" face="courier new,courier" size=2>', '</font></td></tr></table></td></tr></table></td></tr></table>')
    GUICtrlSetData($sPass4, "")
    GUICtrlSetData($sPass4, $aPass3[0] & @CRLF & $aPass3[1] & @CRLF & $aPass3[2])
EndFunc

Func Restart()
    ; Restart your program - http://www.autoitscript.com/forum/index.php?s=&showtopic=19370&view=findpost&p=199608
    ; Author UP_NORTH
    If @Compiled = 1 Then
        Run(FileGetShortName(@ScriptFullPath))
    Else
        Run(FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath))
    EndIf
    Exit
EndFunc   ;==>Restart

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now