コード例 #1
0
    def test_calc_entropy(self):
        password_profile = {
            "site": "example.org",
            "login": "******",
            "counter": 1,
        }
        master_password = "******"

        self.assertEqual(
            password._calc_entropy(password_profile, master_password),
            b"dc33d431bce2b01182c613382483ccdb0e2f66482cbba5e9d07dab34acc7eb1e",
        )
コード例 #2
0
    def test_calc_entropy(self):
        password_profile = {
            "site": "example.org",
            "login": "******",
            "counter": 1,
        }
        master_password = "******"

        self.assertEqual(
            password._calc_entropy(password_profile, master_password),
            99600400399777174105034830393873797761817714609490038944205586760025858632478,
        )
コード例 #3
0
    def test_render_password(self):
        password_profile = {
            "site": "example.org",
            "login": "******",
            "digits": True,
            "lowercase": True,
            "length": 14,
            "counter": 1,
        }
        master_password = "******"
        entropy = password._calc_entropy(password_profile, master_password)

        self.assertEqual(password._render_password(entropy, password_profile),
                         "gsrwvjl03d0asn")
コード例 #4
0
 def test_can_reverse_entropy(self):
     password_profile = {
         "site": "lesspass.com",
         "login": "******",
         "lowercase": True,
         "uppercase": False,
         "digits": False,
         "symbols": False,
         "length": 11,
         "counter": 1,
     }
     master_password = "******"
     entropy = password._calc_entropy(password_profile, master_password)
     old_entropy = reverse_entropy("oldpassword", password_profile)
     oldpassword = password._render_password(old_entropy, password_profile)
     self.assertEqual(oldpassword, "oldpassword")