<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl
#genpasswd.pl - generate secure passwords


# umfang des passwortspektrums festlegen
$numbers		= "1234567890";
$alpha_small 		= "abcdefghijklmnopqrstuvwxyz";
$alpha_big		= "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$extra			= "!@#$%^&amp;*()_+-=[]{}\|;':\",./&lt;&gt;?`";

# string in array umwandeln
@numbers 	= split(//,$numbers);
@alpha_small 	= split(//,$alpha_small);
@alpha_big 	= split(//,$alpha_big);
@extra		= split(//,$extra);

# programm aufrufen
&amp;main_routine;


sub main_routine {


# variabel mit wert aus zufallsgenerator auffüllen
my @rand_id_num = rand_choice_number();
my @rand_id_sma = rand_choice_small();
my @rand_id_big = rand_choice_big();
my @rand_id_ext = rand_choice_extra();


# zuordnung zufallszahl zu umfang des passwortspektrums
foreach $num (@rand_id_big) {
	push(@passwd_raw,@alpha_big[$num]);
}

foreach $num (@rand_id_num) {
	push(@passwd_raw,@numbers[$num]);
}

foreach $num (@rand_id_sma) {
	push(@passwd_raw,@alpha_small[$num]);
}

foreach $num (@rand_id_ext) {

	push(@passwd_raw,@extra[$num]);
}


$passwd =  @passwd_raw[0] . @passwd_raw[1] . @passwd_raw[2] . @passwd_raw[3] .@passwd_raw[4] .@passwd_raw[5] . @passwd_raw[6] .@passwd_raw[7] . @passwd_raw[8] . @passwd_raw[9]. @passwd_raw[10];


print "$passwd\n";


sub rand_choice_extra {

	@random_numbers1 = ();

	$rand_choice_1 = int( rand(31)) + 0;
	$rand_choice_2 = int( rand(31)) + 0;
	$rand_choice_3 = int( rand(31)) + 0;

	push(@random_numbers1,$rand_choice_1);
	push(@random_numbers1,$rand_choice_2);
	push(@random_numbers1,$rand_choice_3);
	return @random_numbers1;

}

sub rand_choice_small {

	@random_numbers2 = ();

	$rand_choice_1 = int( rand(26)) + 0;
	$rand_choice_2 = int( rand(26)) + 0;
	$rand_choice_3 = int( rand(26)) + 0;

	push(@random_numbers2,$rand_choice_1);
	push(@random_numbers2,$rand_choice_2);
	push(@random_numbers2,$rand_choice_3);
	return @random_numbers2;

}

sub rand_choice_big {

	@random_numbers3 = ();

	$rand_choice_1 = int( rand(26)) + 0;
	$rand_choice_2 = int( rand(26)) + 0;
	$rand_choice_3 = int( rand(26)) + 0;

	push(@random_numbers3,$rand_choice_1);
	push(@random_numbers3,$rand_choice_2);
	push(@random_numbers3,$rand_choice_3);
	return @random_numbers3;

}

sub rand_choice_number {

	@random_numbers4 = ();

	$rand_choice_1 = int( rand(10)) + 0;
	$rand_choice_2 = int( rand(10)) + 0;
	$rand_choice_3 = int( rand(10)) + 0;

	push(@random_numbers4,$rand_choice_1);
	push(@random_numbers4,$rand_choice_2);
	push(@random_numbers4,$rand_choice_3);
	return @random_numbers4;

}

} #main_routine</pre></body></html>