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