Ejemplo n.º 1
0
    def __init__(self):
        self.status = False
        self.send_email = False
        self.sound = True
        self.sound_running = False
        self.interval = 15
        self.send_notification = False
        self.minimized = False
        self.sound_timer = None
        self.timer = None

        with open('loginDetails.yml') as file1:
            self.config_file = yaml.safe_load(file1)
        self.login = self.config_file['pg_user']['login']
        self.password = crypter.decrypt(
            self.config_file['pg_user']['password'])
        self.link = self.config_file['pg_user']['link']
        self.whole_look_for = self.config_file['pg_user']['look_for']
        self.look_for = self.whole_look_for.split(';')
        self.where_to_email = self.config_file['settings'][
            'where_to_send_email']
        self.send_email = self.config_file['settings']['send_email']
        self.sound = self.config_file['settings']['sound']
        self.send_notification = self.config_file['settings']['notification'][
            'send_notification']
        self.interval = self.config_file['settings']['interval']
        self.number_of_exercises = self.config_file['settings'][
            'number_of_exercises']
        #self.private_key = self.config_file['settings']['notification']['private_key']
        self.private_key = crypter.decrypt(
            self.config_file['settings']['notification']['private_key'])
        self.device_ID = self.config_file['settings']['notification'][
            'device_ID']
Ejemplo n.º 2
0
def execute_remove_method(master_password, args):
    accounts_for_website = database.select_given_website(args[0])

    for account in accounts_for_website:
        if account[0] == args[1]:
            _ = crypter.decrypt(account[1], master_password)
            return database.remove_user(args[0], args[1])
Ejemplo n.º 3
0
def static_audio(mfile):
    if mfile.rsplit('.')[1] == "mp3":
        ciphered_filename = mfile.split('-')[2][:-4]
        real_filename = crypter.decrypt(ciphered_filename)
        real_filename = mfile.replace(ciphered_filename, real_filename)
        return static_file(real_filename, root="mp3subset")
    return ''
Ejemplo n.º 4
0
    def decrypt(self, string):

        for i in range(self.repeat):

            string_todecrypt = decrypt(string, self.password)

            string = string_todecrypt

        return string
Ejemplo n.º 5
0
def print_rows(rows, master_password, pass_index=2):
    if rows == -1:
        return False

    for row in rows:
        row = list(row)
        row[pass_index] = crypter.decrypt(row[pass_index], master_password)
        print(row)

    return True
Ejemplo n.º 6
0
def decrypt(hash):
    # obj2 = AES.new(crypter.pad(password), AES.MODE_GCM, iv.encode())
    print(crypter.decrypt(key=crypter.pad(hash), ciphertext=ciphertext))
Ejemplo n.º 7
0
 def de():
     for i in listdir('files'):
         sec.decrypt('files/' + i, Fernet(hkey))