How to do it...

Execute the following steps to hide a secret message inside the Lena image using LSB data hiding and use (non-blind) steganalysis to detect the secret message:

  1. Read the (cover) image and hide a long message (by concatenating a message 10 times) inside the image. Save the stego image:
cover = Image.open('images/lena.png') stego = lsb.hide("images/lena.png", 10*"Python Image Processing \                    Cookbook - LSB data hiding with Stegano") stego.save("images/lena-secret.png")
  1. Print the message hidden inside the stego image:
print(lsb.reveal("images/lena-secret.png"))
  1. Do parity steganalysis and extract the parity encoded cover and stego images. Then, use statistical steganalysis to retrieve the common cover and stego images using t ...

Get Python Image Processing Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.