Example #1
0
 def _run_command_execution(self):
     """ Run function for class.                                      """
     ####################################################################
     print("If the password returned is not correct, you may need more shares")
     shares = input("Enter comma separated list of shares: ")
     shares = shares.split(",")
     shares = map(str.strip, shares)
     print(pk_recover_secret(shares))
Example #2
0
 def test_split_secret_failure(self):
     """test recovery failure with not enough shares"""
     passwd = escrow.pk_recover_secret(self.shares[0:1])
     self.assertNotEqual(passwd, PASSWORD)
Example #3
0
 def test_split_secret_min_shares(self):
     """test recovery with min shares functionality"""
     passwd = escrow.pk_recover_secret(self.shares[0:2])
     self.assertEqual(passwd, PASSWORD)
Example #4
0
 def test_spliting_with_no_min(self):
     shares = escrow.pk_split_secret(PASSWORD, ["r1", "r2", "r3"], None)
     passwd = escrow.pk_recover_secret(shares)
     self.assertEqual(passwd, PASSWORD)
Example #5
0
 def test_spliting_with_no_min(self):
     """Test SSSS without a minimum requirement"""
     shares = escrow.pk_split_secret(PASSWORD, ["r1", "r2", "r3"], None)
     passwd = escrow.pk_recover_secret(shares)
     self.assertEqual(passwd, PASSWORD)
Example #6
0
 def test_split_secret_all_shares(self):
     """test recovery with all shares functionality"""
     passwd = pk_recover_secret(self.shares)
     self.assertEqual(passwd, PASSWORD)