-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Seema.py
229 lines (146 loc) · 5.79 KB
/
Seema.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# Author = Adarsh Addee
# Aim = Create RANDOM Passwords And Protect From Hackers
# VERSION = 2.1.0
# NOTE: THIS TOOL IS ONLY FOR EDUCATIONAL PURPOSE
import os
import random
import string
from termcolor import colored
# to clear the screen
os.system("clear")
# input
input(colored("Press ENTET key to continue.............", "red"))
# to clear the screen
os.system("clear")
print("\n")
print("\t\t #Make_In_India")
# logo
print(colored(" ", "red"))
print(colored(" ██████ ▓█████ ▓█████ ███▄ ▄███▓ ▄▄▄ ", "red"))
print(colored(" ▒██ ▒ ▓█ ▀ ▓█ ▀ ▓██▒▀█▀ ██▒▒████▄ ", "red"))
print(colored(" ░ ▓██▄ ▒███ ▒███ ▓██ ▓██░▒██ ▀█▄ ", "red"))
print(colored(" ▒ ██▒▒▓█ ▄ ▒▓█ ▄ ▒██ ▒██ ░██▄▄▄▄██ ", "red"))
print(colored(" ▒██████▒░▒████▒░▒████▒▒██▒ ░██▒ ▓█ ▓██▒", "red"))
print(colored(" ▒ ▒▓▒ ▒ ░░░ ▒░ ░░░ ▒8 ░░ ▒░ ░ ░ ▒▒ ▓▒█░", "red"))
print(colored(" ░ ░▒ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ▒ ▒ ░", "red"))
print(colored(" ░ ░ ░ ░ ░ ░ ", "red"),colored("PASSWORD GENERATING", "yellow"), colored( "▒ ", "red"))
print(colored(" ░ ░ ░ ░ ░ ░ ", "red"), colored(" TOOL", "yellow")+ colored( " ░", "red"))
print(colored(" ░ ░ ░ ░ ░ ░ ░ ░ ", "red"))
print(colored("\t\t\t Created by AdarshAddee", "green"))
print("\n")
# social links
print(colored(" Youtube: Adarsh Addee", "green"))
print(colored(" Youtube: Mr idealhat", "green"))
print(colored(" Youtube: Mr ideal", "green"))
print(colored("\n\n>>> Q. Which type of password do you want to generate?", "red"))
# user options
print(colored(" [ 1 ] Easy", "yellow"))
print(colored(" [ 2 ] Medium", "yellow"))
print(colored(" [ 3 ] Hard", "yellow"))
print(colored(" [ 9 ] Exit\n", "yellow"))
#user input
user_ch = int(input(colored("Enter your choice:\nAD4rSH_> ", "cyan")))
# if user's choice is 2, then
if user_ch == 1:
#charcters
char = []
char.extend(list(string.ascii_letters))
random.shuffle(char)
# password length
plen = int(input(colored("\nEnter your password length: \nAD4rSH_> ", "blue")))
# logic
passwrd = "".join(char[0:plen])
# printing password
print("Your password is: ", "".join(passwrd))
# to save the password
sav = input(colored("\nDo you want to save your password (y/n) : \nAD4rSH_> ", "magenta"))
# if user don't save the password
if sav == "n" or sav == "N":
print(colored("\nBye - Bye\n\n", "red"))
# if user save password
elif sav == "y" or sav == "Y":
# asking for password name
name = input(colored("\nName your password: \nAD4rSH_> ","red"))
# to save the password
dict = {name:passwrd}
# file handling
with open("easy.txt", "a") as f:
f.write(str(dict))
f.write("\n")
# sucessful message
print(colored("\nSucessfully added.....................\n\n", "blue"))
# else statement
else:
print(colored("\nPlease enter a valid value!!!\n\n", "red"))
# if user's choice is 2, then
elif user_ch == 2:
#charcters
char = []
char.extend(list(string.ascii_letters))
char.extend(list(string.digits))
random.shuffle(char)
# password length
plen = int(input(colored("\nEnter your password length: \nAD4rSH_> ", "blue")))
# logic
passwrd = "".join(char[0:plen])
# printing password
print("Your password is: ", "".join(passwrd))
# to save the password
sav = input(colored("\nDo you want to save your password (y/n) : \nAD4rSH_> ", "magenta"))
# if user don't save the password
if sav == "n" or sav == "N":
print(colored("\nBye - Bye\n\n", "red"))
# if user save password
elif sav == "y" or sav == "Y":
# asking for password name
name = input(colored("\nName your password: \nAD4rSH_> ","red"))
# to save the password
dict = {name:passwrd}
# file handling
with open("medium.txt", "a") as f:
f.write(str(dict))
f.write("\n")
# sucessful message
print(colored("\nSucessfully added.....................\n\n", "blue"))
# else statement
else:
print(colored("\nPlease enter a valid value!!!\n\n", "red"))
# if user's choice is 3, then
elif user_ch == 3:
#charcters
char = []
char.extend(list(string.ascii_letters))
char.extend(list(string.digits))
char.extend(list(string.hexdigits))
char.extend(list(string.punctuation))
random.shuffle(char)
# password length
plen = int(input(colored("\nEnter your password length: \nAD4rSH_> ", "blue")))
# logic
passwrd = "".join(char[0:plen])
# printing password
print("Your password is: ", "".join(passwrd))
# to save the password
sav = input(colored("\nDo you want to save your password (y/n) : \nAD4rSH_> ", "magenta"))
# if user don't save the password
if sav == "n" or sav == "N":
print(colored("\nBye - Bye\n\n", "red"))
# if user save password
elif sav == "y" or sav == "Y":
# asking for password name
name = input(colored("\nName your password: \nAD4rSH_> ","red"))
# to save the password
dict = {name:passwrd}
# file handling
with open("hard.txt", "a") as f:
f.write(str(dict))
f.write("\n")
# sucessful message
print(colored("\nSucessfully added.....................\n\n", "blue"))
# else statement
else:
print(colored("\nPlease enter a valid value!!!\n\n", "red"))
elif user_ch == 9:
print(colored("\nSee you again!!!\n", "red"))
else:
print(colored("Please enter a valid value", "red"))