Re: Use SPSS to generate random passwords

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Use SPSS to generate random passwords

Kim Jinnett
I'm looking for advice on generating a set of random passwords that
would meet the following criteria:

1. Use 8 characters or more
2. Use mixed case letters (upper and lower case)
3. Use more than one number
4. Use special characters (!, @, #, etc.)

I'm hoping I can use SPSS syntax and random number generation to cobble
together some alpha-character-numeric passwords that meet the above
criteria (I need about 500).

Any advice appreciated.

Thank you,

Kim
Reply | Threaded
Open this post in threaded view
|

Re: Use SPSS to generate random passwords

Spousta Jan
Hi Kim,

Try this:

* Set Mersenne twister and random seed.
SET
  RNG=MT
  MTINDEX=RANDOM.

* Generate a file with passwords.
INPUT PROGRAM.
- string passwd (a25).
- LOOP #I = 1 TO 500.
-   loop.
-     compute #numbers = 0 /*counts numbers in the string - there should
be at least two numbers there*/.
-     loop #j = 1 to 25.
-       compute #pos = trunc(uniform(75))+1.
-       compute substr(passwd,#j,1) =
substr('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@
#$%^&*()<>?', #pos, 1).
-       if (#pos <= 10) #numbers = #numbers + 1.
-     end loop.
-   end loop if (#numbers > 1)  /*cancel all strings without two and
more numbers*/.
-   END CASE.
- END LOOP.
- END FILE.
END INPUT PROGRAM.
EXE.

Hope this helps,

Jan

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Kim Jinnett
Sent: Wednesday, January 31, 2007 1:15 AM
To: [hidden email]
Subject: Re: Use SPSS to generate random passwords

I'm looking for advice on generating a set of random passwords that
would meet the following criteria:

1. Use 8 characters or more
2. Use mixed case letters (upper and lower case) 3. Use more than one
number 4. Use special characters (!, @, #, etc.)

I'm hoping I can use SPSS syntax and random number generation to cobble
together some alpha-character-numeric passwords that meet the above
criteria (I need about 500).

Any advice appreciated.

Thank you,

Kim