def add_new_application(): passwords = [] print 'How many passwords would you like to generate:' num_pass = int(input()) for i in range(num_pass): passwords.append(gen_pass.generate_password(25, -1, 1, 1, 1, 1)) print "\n\tGENERATED PASSWORDS" print "---------------------------------------" for i in range(len(passwords)): print str(i+1) + ' - ' + passwords[i] print '\n\nSelected Password : '******'Selected Password : '******'Password Copied to Clipboard' print '\n\n\nWhat is the Application Name you want the password for : ' application_name = raw_input('Application Name : ') data.append([application_name, encryption.encrypt_data(passwords[selected_pass], 'paradise')]) save_data(data)
def input_password(): name = input('Name: ') site = input('Site: ') if not name and site: name = site elif not name and not site: name = '(unnamed)' username = input('Username: '******'Do you want to generate a password? Y/N: ').upper() if generate == 'Y': print() while True: password = generate_password() if password: break else: password = input('Password: '******'name': name, 'site': site, 'username': username, 'password': password} return entry
def initUI(self): uic.loadUi(REGISTRATION_UI, self) self.setWindowFlags(Qt.WindowMaximizeButtonHint) self.ok_btn.clicked.connect(self.run) self.password_text.setText(generate_password(15))
def home(): return render_template('home.html', default_password=generate_password(), title='Home')
def create_password(): password_options = request.args.to_dict() return generate_password(**password_options)
import os from flask import Flask, request, render_template, flash, url_for, redirect, session from datetime import timedelta, datetime from generate_password import generate_password from init import init_mysql, init_google, init_github from authlib.integrations.flask_client import OAuth app = Flask(__name__) app.secret_key = generate_password() app.permanent_session_lifetime = timedelta(days=180) db = init_mysql() # OAuth apps oauth = OAuth(app) google = init_google(oauth) github_blueprint = init_github() app.register_blueprint(github_blueprint, url_prefix="/github_login") cursor = db.cursor() cursor.execute( "CREATE TABLE IF NOT EXISTS USERS (USERNAME VARCHAR(10) UNIQUE NOT NULL, PASSWORD VARCHAR(10) NOT NULL, DESCRIPTION VARCHAR(100) NOT NULL)" ) cursor.execute( "CREATE TABLE IF NOT EXISTS POSTS (POSTID INTEGER PRIMARY KEY AUTO_INCREMENT, TITLE VARCHAR (20), CONTENT VARCHAR(200), AUTHOR VARCHAR(10), CREATED_AT DATETIME)" ) db.commit() # Global Variables authentication = False
def main(): print gen_pass.generate_password(25, 'DiehardOfDeath', 1, 1, 1, 1)
def test_nocopy(self): pyperclip.copy('blank') password = generate_password(clipboard=False) self.assertNotEqual(password, pyperclip.paste())
def test_upper(self): password = generate_password() self.assertRegex(password, '[ABCDEFGHIJKLMNOPQRSTUVWXYZ]')
def test_symbol(self): password = generate_password() self.assertRegex(password, r'[\!\"\£\$\%\^\&\*\(\)\-\_\=\+\[\]\{\}\@\~\#\,\.\<\>\/\?\|]')
def test_number(self): password = generate_password() self.assertRegex(password, '[0123456789]')
def test_minlength(self): password = generate_password(length=5) self.assertIn('ERROR', password)
def test_length(self): password = generate_password() self.assertGreaterEqual(len(password),8)
def random_password(): password = generate_password() password_input.insert(0, password) pyperclip.copy(password)
def password_generate(): if password_entry.get(): password_entry.delete(0, tkinter.END) password = generate_password() password_entry.insert(0, password)