- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpassword.java
More file actions
Latest commit
68 lines (48 loc) · 1.65 KB
/
Copy pathpassword.java
File metadata and controls
68 lines (48 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
publicclassMain
{
publicstaticvoidmain (String[] args)
{
Stringtext = "1BB456!8";
intcount = 0;
charG;
intbuchstaben = 0;
intziffern = 0;
booleanletter_check = false;
booleannumber_check = false;
booleansonderzeichen_check = false;
booleanminzeichen_check = false;
booleanbigletter_check = false;
intleange = text.length();
System.out.print("dein passwort lautet: ");
while (count < leange)
{
G = text.charAt(count);
if (Character.isLetter(G)) buchstaben++;
if (Character.isDigit(G)) ziffern++;
if (Character.isUpperCase(G)) bigletter_check = true;
System.out.print(G); // <- der ist gut lol^^
count++;
}
System.out.println();
if (count < 8)
{
System.out.println("mindestens 8 zeichen");
}
else
{
minzeichen_check = true;
if (text.matches("^[a-zA-Z0-9]+")) System.out.println("* kein sonderzeichen drinne");
elsesonderzeichen_check = true;
if (bigletter_check == false) System.out.println("* kein gross buchstabe");
elsebigletter_check = true;
if (buchstaben < 2) System.out.println("* mindestens 2 buchstaben");
elseletter_check = true;
if (ziffern < 2) System.out.println("* mindestens 2 ziffern");
elsenumber_check = true;
}
if (minzeichen_check == true && sonderzeichen_check == true && letter_check == true && number_check == true && bigletter_check == true)
System.out.println("heftiges passwort");
else
System.out.println("\nkonzentrier dich!!!! und mach es nochmal n00b");
}
}