On 17-Jun-2010 06:00, Don Cavaiani wrote:
mixture of alpha and numeric (4 of each would be nice) - 8 long,
no Caps and no special characters
Dennis Lovelady on Thursday, June 17, 2010 7:26 AM wrote:
Need to know your password rules. All alpha? All numeric?
Spaces allowed? ...
Anyone know of a free program which will randomly generate a
file of passwords (approx. 500 of them)?
SQL is /free/ and has the scalar function RAND() which can assist
to choose characters from a string of valid characters. Something
like the following SELECT, for example:
<code>
with
validchar1 (inpstring) as
( select
'abcdefghijklmnopqrstuvwxyz012345678901234567890123456789'
/* repeated digits improves distribution per /nice/ */
/* drop vowels & a set of digits; avoid /bad/ words? */
from sysibm/sysdummy1 )
,validchar2 (inpstring, inplength) as
( select inpstring, decimal(length(inpstring), 3, 0)
from validchar1 )
,validchar3 (inpstring, inplength, ii) as
( select inpstring, inplength
, decimal( inplength - 0.01, 5, 2)
/* omit value of /one/ inclusive by rand(), using ii */
from validchar2 )
select /* concatenate 8 random bytes of input as output */
substr( inpstring, int(rand()*ii+1.0), 1 )
/* substr( inpstring, int(rand()*(ii-30)+1.0), 1 ) */
/* or subtraction prevents a digit as first character */
concat substr( inpstring, int(rand()*ii+1.0), 1 )
concat substr( inpstring, int(rand()*ii+1.0), 1 )
concat substr( inpstring, int(rand()*ii+1.0), 1 )
concat substr( inpstring, int(rand()*ii+1.0), 1 )
concat substr( inpstring, int(rand()*ii+1.0), 1 )
concat substr( inpstring, int(rand()*ii+1.0), 1 )
concat substr( inpstring, int(rand()*ii+1.0), 1 )
from validchar3
cross join a500plusRowFile
/* 500 rows generated by recursive CTE good since v5r4 */
fetch first 500 rows only
</code>
Regards, Chuck
As an Amazon Associate we earn from qualifying purchases.