Jump to content
Sign in to follow this  
LiquidNitrogen

Password Gen

Recommended Posts

Numeric/Alphanumeric Password Generator. Includes ability to Choose Character Limit up To 50 With a Minimum of 5.

Password Gen.au3

Update!

#NoTrayIcon
Main()
Func Main()
GUICreate("Password Gen - ReaperX", 278, 120)
GUICtrlCreateLabel("Password:", 10, 20)
$Pass = GUICtrlCreateInput("", 65, 19, 200, 18, BitOR(BitOR(0, 128), 2048))
$Nums = GUICtrlCreateRadio("Numbers", 65, 40)
$DNL = GUICtrlCreateRadio("Numbers And Letters", 140, 40)
$Gen = GUICtrlCreateButton("Generate", 100, 80, 80, 30)
$Cpy = GUICtrlCreateButton("Copy", 180, 80, 80, 30)
$Lmt = GUICtrlCreateInput("20", 20, 80, 40, 20, 2048)
GUICtrlCreateGroup("Char Limit", 0, 60, 80, 60)
GUICtrlSetLimit(GUICtrlCreateUpdown($Lmt), 50, 5)
GUICtrlSetFont(GUICtrlCreateLabel("Max: 50", 20, 102, 40, 10), 7)
GUICtrlSetLimit($Lmt, 2, 0)
GUICtrlSetState($Nums, 1)
GUISetState()
While 1
  $Msg = GUIGetMsg()
  Switch $Msg
   Case -3
    Exit
   Case $Gen
    If GUICtrlRead($Lmt) > 50 Then GUICtrlSetData($Lmt, 50)
    If GUICtrlRead($Nums) = 1 Then
     GUICtrlSetData($Pass, "")
     $Int = ''
     $ICL = GUICtrlRead($Lmt)
     For $i = 1 To $ICL
      $Int &= Random(0, 9, 1)
      If StringLen($Int) > $ICL Then ExitLoop
     Next
     GUICtrlSetData($Pass, $Int)
    EndIf
    If GUICtrlRead($DNL) = 1 Then
     GUICtrlSetData($Pass, "")
     $Char = ''
     $ICL = GUICtrlRead($Lmt)
     For $i = 1 To $ICL
      Switch Random(1, 3, 1)
       Case 0
        $Char &= Chr(Random(32, 64, 1))
       Case 1
        $Char &= Chr(Random(65, 90, 1))
       Case 2
        $Char &= Chr(Random(97, 122, 1))
       Case 3
        $Char &= Random(0, 9, 1)
      EndSwitch
      If StringLen($Char) > $ICL Then ExitLoop
     Next
     GUICtrlSetData($Pass, $Char)
    EndIf
   Case $Cpy
    If StringLen(GUICtrlRead($Pass)) > 0 Then
     ClipPut(GUICtrlRead($Pass))
     MsgBox(0, "Password Gen", "Password Copied to Clipboard!")
    EndIf
  EndSwitch
WEnd
EndFunc   ;==>Main

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...