Skip to content

Latest commit

 

History

History
61 lines (36 loc) · 2.47 KB

README.md

File metadata and controls

61 lines (36 loc) · 2.47 KB

Web-based steganography tool

Routes

Homepage

image

  • Route: /
  • Displays the index page with options for encoding, decoding, and viewing the last encoded image or decoded message.

404 Error Page

  • Route: /404
  • Displays a custom error page when a page is not found.

Display Last Encoded Image

  • Route: /image/last/encoded
  • Displays the last encoded image, if available.

Display Last Decoded Message

  • Route: /image/last/decoded
  • Displays the last decoded message, if available.

Encode Message into Image

image

  • Route: /encode
  • Allows users to encode a message into a PNG image.

Decode Message from Image

image

  • Route: /decode
  • Allows users to decode a message from a PNG image.

Steganography

For the encoding process, I have converted the input message to binary, the input image to binary (it must be .PNG, otherwise it won't work) and encoded them according to the formula. I have added a stop string ("$#&") at the end, to know where to stop in the decoding process. Basically, the message + $#& is encoded in the pixels of the image, and when the message is fully traversed, then the pixel traversal is exited. The image is saved at path:"public/images/encoded_image.png" so that it can also be displayed at the path "image/last/encoded", but also for the last encoded image.

For the decoding process, I have converted the image back to binary and went pixel by pixel and did the reverse of the encoding. I also checked the stop string ("$#&"), so I know when to stop and not loop through the whole image for nothing. The received binary message is then converted to ASCII by evaluating chunks of 8 bits each. The final message is written to path:"public/message/message.txt" to be displayed in the last message decoded section and in the "image/last/decoded" path.

Dockerfile

The docker image has the FLASK and PILLOW requirements. So, to create the docker image, you have to use this command:

    docker build -t iap-tema2 .

and to start it, use this command:

    docker run -p 8080:80 -it iap-tema2

It should be available Here