-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPyPassGen.py
More file actions
54 lines (36 loc) · 1.4 KB
/
PyPassGen.py
File metadata and controls
54 lines (36 loc) · 1.4 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
# PyPass : A python script to generate random and strong passwords.
# Generate passwords as per your desired length
# Generate as many password you want in a single run
from random import choice
# User defined Inputs
pass_len=input("Your desired Password Length (ie : 0-16) characters : ")
pass_no=input('How many Passowords ? : ')
# Casting string to integers
cast_pass_len=int(pass_len)
cast_pass_no=int(pass_no)
keyboard_char='abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*_-'
print()
for i in range(cast_pass_no):
if i == 0:
print('Here are your', cast_pass_no, 'random passwords ! \n')
hard_pass=''
for j in range(cast_pass_len):
hard_pass+=choice(keyboard_char)
print(hard_pass)
# Same Script as an User defined function.
def Gen_Strong_Pass(pass_len,pass_no):
# User defined Inputs
pass_len=input("Your desired Password Length (ie : 0-16) characters : ")
pass_no=input('How many Passowords ? : ')
# Casting string to integers
cast_pass_len=int(pass_len)
cast_pass_no=int(pass_no)
print()
for i in range(cast_pass_no):
if i == 0:
print('Here are your', cast_pass_no, 'random passwords ! \n')
hard_pass=''
for j in range(cast_pass_len):
hard_pass+=choice(keyboard_char)
print(hard_pass)
Gen_Strong_Pass(8,3)