import java.security.SecureRandom;
import java.util.Scanner;
public class ac {
public static void main(String[] args) {
Scanner scan = new Scanner( System.in );
SecureRandom random = new SecureRandom();
int passwordlaenge;
int z=0;
String pwd= "";
char[] erlaubteZeichen = new char [] { 'A', 'B', 'C', 'D',
'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
+ 'a', 'b', 'c', 'd',
'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q',
'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' +
'0', '1', '2', '3', '4',
'5', '6', '7', '8', '9'
+ '~', '`', '!', '@', '#',
'$', '%', '^', '&', '*', '(', ')', '-', '_', '=', '+', '[', '{',
']', '}', '\\', '|', ';', ':', '\'', '"', ',', '<', '.', '>', '/',
'?' };
System.out.println("Ihr Passwort muss mindestens aus 8 Zeichen bestehen.");
System.out.print("Aus wie vielen Zeichen soll Ihr Passwort bestehen? ");
passwordlaenge= scan.nextInt();
while (z< passwordlaenge){
pwd+= erlaubteZeichen[random.nextInt(erlaubteZeichen.length)];
z ++;
}
System.out.println(pwd);
}
}