-
Notifications
You must be signed in to change notification settings - Fork 0
/
Generator.py
87 lines (57 loc) · 1.95 KB
/
Generator.py
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import string
import secrets
# This is an example on how to use strings, in this case symbols
symbols = string.punctuation
"""
Function which returns the alphabet from which our password will be generated
numbers: does the alphabet contain numbers
symbols: does the alphabet contain symbols
return: string with the whole alphabet
"""
def Create_Alphabet(numbers=False, symbols=False) -> str:
pass
"""
Function which returns a true random character from the alphabet
Use the secrets module
alphabet: string with the alphabet for the password
return: a random character within the alphabet
"""
def Random_Char(alphabet: str) -> str:
pass
"""
Generates the password with the specified params
size: The number of characters in the password
numbers: if numbers are enabled
symbols: if symbols are enabled
"""
def Generate_Password(size: int, numbers: bool, symbols: bool) -> str:
pass
"""
This functions has to check if the password respects strong constraints
meaning: at least <numbers> numbers and <symbols> symbols if there are enabled.
It should also check for the existence of a lowercase and uppercase character
It is recommended to have at least 1 number and 1 symbol
password: the password to check
numbers: minimum numbers required
symbols: minimum symbols requires
return: a boolean that checks password constraints
"""
def Check_Password(password: str, numbers=1, symbols=1) -> bool:
pass
"""
This function has to write the password to the destination file:
password: the generated password to be written
destination: the file in which to write
"""
def Write_Password(password: str, destination: str):
pass
"""
Main function to call
It should use IO calls to handle password generation parameters
and to write it to "password.txt"
This means it should use all functions from before
If the password fails CheckPassword, it should regenerate a new password
"""
def Generate():
test = input("Input a message to be printed")
print(test)