AutoHotkey Community

It is currently May 26th, 2012, 4:47 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: ahkSalt Generator
PostPosted: April 3rd, 2009, 3:32 am 
Offline

Joined: May 7th, 2008, 5:37 pm
Posts: 87
Location: In your Internets
Just a random code i whipped up in an hour.
This program can be used to generate passwords or salts.
It generates a random string, and pulls random characters out of the string. NOTE: no character is used twice.
Change your desired length in the loop , 4 portion near the return statement.

Examples:
12 Length
Source string:Randomized password
Z8n1SXH4O5zjQm3oeWNCFG97xKL2YTipr6flJ0qdBkUDyvEVsMIAPwRuchagbt:6VCmBcOngr
HCs3OexTm9Jqnog2BzwkZ7V0Pub6IQvtcR5rNyWL4K8F1pYljadEAMfihXDSGU:0i59HkdNRzB

4 Length
vx523NU9watOj14dr67IT8gbq0SypfslhcmXPnuiGkozVeJKDLZBCMWQHYRAFE:Lqm9
1h9m8ACzgU6ua05SO4sBc7Mb3lkKrGRpYd2oyvjxTwEetiqWPnfHZJIQLNVXDF:wUu7
Code:
#persistent
numbers=1234567890
lowercase=abcdefghijklmnopqrstuvwxyz
caps=ABCDEFGHIJKLMNOPQRSTUVWXYZ
string=
numtotal=10
lowercasetotal=26
capstotal=26
count=0

while count < 62
{
  random , section , 1 , 3
  if section = 1
  {
    if numtotal > 0
   {
      random , which , 1 , %numtotal%
      gosub translatenum
   }
   else
     section = 2
  }
  if section = 2
  {
    if lowercasetotal > 0
   {
     random , which , 1 , %lowercasetotal%
      gosub translatelower
    }
   else
     section = 3
  }
  if section = 3
    if capstotal > 0
   {
      random , which , 1 , %capstotal%
      gosub translatecaps
   }
}
clipboard:=string
msgbox %string%
loop , 4 ; replace this with your desired salt length
{
  random , which , 1, 63
  loop , parse, string
    if a_index = %which%
   {
      salt=%salt%%a_loopfield%
      string:=regexreplace(string,a_loopfield,"")
   }
}
msgbox %salt%
return

translatenum:
  loop, parse, numbers
    if a_index = %which%
   {
    string=%string%%a_loopfield%
    numbers:=regexreplace(numbers,a_loopfield,"")
    numtotal:=numtotal-1
    count:=count+1
   }
return

translatelower:
  loop, parse, lowercase
   if a_index = %which%
   {
     string=%string%%a_loopfield%
       lowercase:=regexreplace(lowercase,a_loopfield,"")
    lowercasetotal:=lowercasetotal-1
    count:=count+1
   }
return

translatecaps:
  loop, parse, caps
    if a_index = %which%
   {
    string=%string%%a_loopfield%
    caps:=regexreplace(caps,a_loopfield,"")
    capstotal:=capstotal-1
    count:=count+1
   }
return



Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Rajat and 7 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group