How do I create a random alphanumeric password for new users?

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

When you paste it using a special program (which requires a csv file), the password (in this case an alphanumeric key) is saved as an md5 hash tag.

i.e. I generate a random alphanumeric key:

H2A5D39A -> MD5: 1642fccf791f15d137cf31282af79752

Thus, I want to create a list in which authenticated users can ask me for the initial password (alphanumeric key).

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

How to create an alphanumeric key in Perl?

PS: the "running system", not programmed by us, simply allows alphanumeric passwords (no special characters, ...)

+5
source share
5 answers

How to create an alphanumeric key in Perl?

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

+15
source

I would probably use pwgen. This is great, because it allows you to easily configure and has the switch not to use ambiguous characters (I think: I, l, 1, O, 0).

eg:

=> pwgen -c -n -B 8 50
shuFak9o peiCh3Oo ohPieng9 Vohh7zuu os3Theep aeV9nuo9 aexeik4B aeChoh9s
uth3eePu baePhu3o aiS3pahn iPie4itu We9zuphi xie3Chi3 yeiRoo7c fai3ITai
aCh9ohco Echuab7v Fu9ahCho Aevae4no Peethai9 AiJio3Pa aeNge9Fo baePh7Uy
Nai7shei eeMoh9en Zeibai4n eGe7yuch Jaek7nai aeZah7sh Chei4ua4 shoo9oG9
iu7Wohho aep7De4U Fong9fo3 AhneeP7U oxae7Yoh ahF4eim3 fahm9Aiw naoNg4ie
Chie4xua jix3Uvot aChei7ai diey4Shi Yur7ee4j eeJeo9ee Bou3ahmu kaeb4Cah
Eh4Eemae oD4phoo9
+6
source

, , (, , , ), String:: Random.

+1
+1
0

All Articles