Added support for transparent PNGs in the lsbset module.

This commit is contained in:
Cédric Bonhomme 2017-01-27 23:47:34 +01:00
parent 556a24341e
commit 3e31b38294
No known key found for this signature in database
GPG key ID: A1CB94DE57B7A70D
2 changed files with 22 additions and 5 deletions

View file

@ -53,6 +53,19 @@ class TestLSBSet(unittest.TestCase):
self.assertEqual(message, clear_message)
def test_with_transparent_png(self):
messages_to_hide = ["a", "foo", "Hello World!", ":Python:"]
for message in messages_to_hide:
secret = lsbset.hide("./tests/sample-files/transparent.png",
message, generators.eratosthenes())
secret.save("./image.png")
clear_message = lsbset.reveal("./image.png",
generators.eratosthenes())
self.assertEqual(message, clear_message)
def test_with_too_long_message(self):
with open("./tests/sample-files/lorem_ipsum.txt") as f:
message = f.read()