Exemplo n.º 1
0
 def test_different_hashcode(self):
     """Ensure everytime a different hashcode is generated. This is for preventing Rainbow-tables cracking"""
     hashcode1 = Encryption.generate_hashcode_and_salt(self.password)[0]
     hashcode2 = Encryption.generate_hashcode_and_salt(self.password)[0]
     assert hashcode1 != hashcode2
Exemplo n.º 2
0
 def test_generate_password(self):
     """Ensure generated salt and password could authenticate the original password"""
     hashcode, salt = Encryption.generate_hashcode_and_salt(self.password)
     assert Encryption.check_password(self.password, hashcode, salt)