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
Пример #3
0
 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))
Пример #4
0
def home():
    return render_template('home.html', default_password=generate_password(), title='Home')
Пример #5
0
def create_password():
    password_options = request.args.to_dict()
    return generate_password(**password_options)
Пример #6
0
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)
Пример #8
0
 def test_nocopy(self):
     pyperclip.copy('blank')
     password = generate_password(clipboard=False)
     self.assertNotEqual(password, pyperclip.paste())
Пример #9
0
 def test_upper(self):
     password = generate_password()
     self.assertRegex(password, '[ABCDEFGHIJKLMNOPQRSTUVWXYZ]')
Пример #10
0
 def test_symbol(self):
     password = generate_password()
     self.assertRegex(password, r'[\!\"\£\$\%\^\&\*\(\)\-\_\=\+\[\]\{\}\@\~\#\,\.\<\>\/\?\|]')
Пример #11
0
 def test_number(self):
     password = generate_password()
     self.assertRegex(password, '[0123456789]')
Пример #12
0
 def test_minlength(self):
     password = generate_password(length=5)
     self.assertIn('ERROR', password) 
Пример #13
0
 def test_length(self):
     password = generate_password()
     self.assertGreaterEqual(len(password),8)
Пример #14
0
def random_password():
    password = generate_password()
    password_input.insert(0, password)
    pyperclip.copy(password)
Пример #15
0
def password_generate():
    if password_entry.get():
        password_entry.delete(0, tkinter.END)
    password = generate_password()
    password_entry.insert(0, password)