Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should I generate a random alphanumeric initial password for new users?

We have to automatically import a large list of users with some data into a running system. For an initial password I want to update the list (csv format at the moment) with a random alphanumeric key (8 digits).

When inserting it with a special routine (which needs a csv file), the password (in this case the alphanumeric key) is stored as a md5 hash.

i.e. I generate a random alphanumeric key:

H2A5D39A -> MD5: 1642fccf791f15d137cf31282af79752

This way I want to create a list where authenticated users can ask me for their initial password (the alphanumeric key).

Do you have a better idea for a "secret" initial password?

How would you create the alphanumeric key in Perl?

P.S.: The "running system", not programmed by us, just allowes alphanumeric passwords (no special chars,...)

like image 286
Xn0vv3r Avatar asked Apr 29 '09 08:04

Xn0vv3r


1 Answers

How would you create the alphanumeric key in Perl?

join'', map +(0..9,'a'..'z','A'..'Z')[rand(10+26*2)], 1..8

like image 56
Anonymous Avatar answered Oct 17 '22 15:10

Anonymous