Beispiel #1
0
 def test_StegAndUnsteg(self):
     for i in range(RANDOM_TEST_LOOP_COUNT):
         randomvalidmessage = np.array(
             [random.randint(0, JT65_MAX_SYMBOL) for r in range(64)])
         randomstegmessage = np.array(
             [random.randint(0, JT65_MAX_SYMBOL) for r in range(20)])
         resultA = jts.jtsteg(randomvalidmessage, randomstegmessage,
                              hidekey)
         resultB = jts.jtunsteg(resultA, hidekey)
         self.assertEqual(resultB.tolist(), randomstegmessage.tolist())
Beispiel #2
0
 def test_StegAndUnstegNegative(self):
     for i in range(RANDOM_TEST_LOOP_COUNT):
         randomvalidmessage = np.array(
             [random.randint(0, JT65_MAX_SYMBOL) for r in range(64)])
         randomstegmessage = np.array(
             [random.randint(0, JT65_MAX_SYMBOL) for r in range(20)])
         resultA = jts.jtsteg(randomvalidmessage, randomstegmessage,
                              hidekey)
         resultB = jts.jtunsteg(resultA, hidekey)
         # Should not be equal, unsteg returns the steg message not the
         # valid message
         self.assertNotEqual(resultB.tolist(), randomvalidmessage.tolist())