Пример #1
0
 def test_default(self):
     manager = CtSesam()
     self.assertEqual("5#%KiUvEE7", manager.generate('foo', 'some.domain'))
Пример #2
0
                    answer = input("Sollen sie geladen werden [J/n]? ")
                    if answer not in [
                            "n", "N", "Nein", "nein", "NEIN", "NO", "No", "no",
                            "nay", "not", "Not", "NOT"
                    ]:
                        domain = dom
                        setting_found = True
    setting = settings_manager.get_setting(domain)
    if not setting_found:
        setting.ask_for_input()
    if setting_found and setting.has_username() and not args.quiet:
        print("Benutzername: " + setting.get_username())
    settings_manager.set_setting(setting)
    settings_manager.store_settings(master_password)
    if setting_found and setting.has_legacy_password():
        if args.quiet:
            print(setting.get_legacy_password())
        else:
            print("klassisches Passwort: " + setting.get_legacy_password())
    else:
        sesam = CtSesam()
        sesam.set_password_character_set(setting.get_character_set())
        sesam.set_salt(setting.get_salt())
        password = sesam.generate(master_password, setting.get_domain(),
                                  setting.get_username(), setting.get_length(),
                                  setting.get_iterations())
        if args.quiet:
            print(password)
        else:
            print('Passwort: ' + password)
Пример #3
0
 def test_custom_salt(self):
     manager = CtSesam()
     manager.set_salt(b'qanisaoerna56745678eornsiarteonstiaroenstiaeroh')
     self.assertEqual("CQz7kgz%C.", manager.generate('foo', 'some.domain'))
Пример #4
0
 def test_long(self):
     manager = CtSesam()
     self.assertEqual("5#%KiUvEE7}t<d:Y=Lzn;dKzaG0qU/t)",
                      manager.generate('foo', 'some.domain', length=32))
Пример #5
0
 def test_custom_character_set(self):
     manager = CtSesam()
     manager.set_password_character_set(
         'abcdefghijklmnopqrstuvwxyzABCDUFGHJKLMNPQRTEVWXYZ0123456789#!"§$%&/()[]{}=-_+*<>;:.'
     )
     self.assertEqual("5#%KiEvUU7", manager.generate('foo', 'some.domain'))
 def test_default(self):
     manager = CtSesam()
     self.assertEqual("5#%KiUvEE7", manager.generate('foo', 'some.domain'))
 def test_long(self):
     manager = CtSesam()
     self.assertEqual("5#%KiUvEE7}t<d:Y=Lzn;dKzaG0qU/t)", manager.generate('foo', 'some.domain', length=32))
 def test_custom_salt(self):
     manager = CtSesam()
     manager.set_salt(b'qanisaoerna56745678eornsiarteonstiaroenstiaeroh')
     self.assertEqual("CQz7kgz%C.", manager.generate('foo', 'some.domain'))
 def test_custom_character_set(self):
     manager = CtSesam()
     manager.set_password_character_set('abcdefghijklmnopqrstuvwxyzABCDUFGHJKLMNPQRTEVWXYZ0123456789#!"§$%&/()[]{}=-_+*<>;:.')
     self.assertEqual("5#%KiEvUU7", manager.generate('foo', 'some.domain'))