Eto, program ce generirati password od max. 10 znakova koristeci podatke koje upisete.
Modificirajte ga po potrebi ako vam padne kakva ideja napamet pa podijelite s nama.
A razmisljam si slozit i neki smisleniji password generator, temeljen na nekim standardima u sigurnosti. Kad se malo vise informiram o tome napravit cu i to.
Poz !
Code:
import sys, time
from random import Random
rng = Random()
print '\nSimple Python password generator based on users personal information.\n'
time.sleep(1)
while 1:
first_name = raw_input('Enter your first name : ')
if first_name == '':
continue;
else:
break;
while 1:
last_name = raw_input('Enter your last name : ')
if last_name == '':
continue;
else:
break;
while 1:
birth_date = raw_input('Enter your birth date (For example 01.01.2000 or 01012000) : ')
if birth_date == '':
continue;
else:
break;
date_of_birth_no_dot = birth_date.rsplit(".")
no_dot = ''
for item in date_of_birth_no_dot:
no_dot += str(item)
charachters = first_name + last_name + no_dot
while 1:
try:
password_length = int(raw_input('Enter the desired password length (Max. 10 charachters) : '))
if password_length > 24:
continue;
else:
break;
break;
except:
continue;
def generate_password():
print '\nThe password is : '
for i in range(password_length):
sys.stdout.write(rng.choice(charachters))
exit_gen = str('No')
while 1:
generate_password()
gen_new = raw_input('\nGenerate another ? (Press "Enter" to generate or type "No" to exit) : ')
if gen_new == exit_gen:
break;
else:
continue;
import sys, time
from random import Random
rng = Random()
print '\nSimple Python password generator based on users personal information.\n'
time.sleep(1)
while 1:
first_name = raw_input('Enter your first name : ')
if first_name == '':
continue;
else:
break;
while 1:
last_name = raw_input('Enter your last name : ')
if last_name == '':
continue;
else:
break;
while 1:
birth_date = raw_input('Enter your birth date (For example 01.01.2000 or 01012000) : ')
if birth_date == '':
continue;
else:
break;
date_of_birth_no_dot = birth_date.rsplit(".")
no_dot = ''
for item in date_of_birth_no_dot:
no_dot += str(item)
charachters = first_name + last_name + no_dot
while 1:
try:
password_length = int(raw_input('Enter the desired password length (Max. 10 charachters) : '))
if password_length > 24:
continue;
else:
break;
break;
except:
continue;
def generate_password():
print '\nThe password is : '
for i in range(password_length):
sys.stdout.write(rng.choice(charachters))
exit_gen = str('No')
while 1:
generate_password()
gen_new = raw_input('\nGenerate another ? (Press "Enter" to generate or type "No" to exit) : ')
if gen_new == exit_gen:
break;
else:
continue;
[Ovu poruku je menjao Bouncer dana 10.01.2008. u 16:36 GMT+1]