Example #1
0
 def test_hide_reveal_secret_string_full_depth(self):
     secret = "I am a tomato!" * 145
     save_img, out_key, usage = snt.hide(secret, self.secret_image, depth=8)
     decrypted_secret = snt.reveal(out_key, save_img)
     self.assertTrue(secret == decrypted_secret)
Example #2
0
    def test_data_overflow_exception(self):
        secret = "Tomato " * 1000

        with self.assertRaises(snt.DataOverflowException):
            snt.hide(secret, self.secret_image)
Example #3
0
 def test_key_format_exception(self):
     secret = "I am a tomato!"
     save_img, out_key, usage = snt.hide(secret, self.source_image)
     out_key_modified = out_key + ";1234;1234"
     with self.assertRaises(snt.KeyFormatException):
         snt.reveal(out_key_modified, save_img)
Example #4
0
    def test_invalid_key_exception(self):
        secret = "I am a potato!"
        save_img, out_key, _ = snt.hide(secret, self.source_image)

        with self.assertRaises(snt.InvalidKeyException):
            snt.reveal("1234;1234;1234", save_img)
Example #5
0
    def test_hide_reveal_secret_string_color(self):
        secret = "Colors are cool!"
        save_img, out_key, usage = snt.hide(secret, self.color_image)

        decrypted_secret = snt.reveal(out_key, save_img)
        self.assertTrue(secret == decrypted_secret)
Example #6
0
 def test_hide_reveal_secret_unicode_string(self):
     secret = "🦥 eat 🍅!"
     save_img, out_key, usage = snt.hide(secret, self.source_image)
     decrypted_secret = snt.reveal(out_key, save_img)
     self.assertTrue(secret == decrypted_secret)