This is my school project (AS Level) under Mr Simon Carter. In this project, I embed the text message inside an image so that the text message is hidden
I created an odd-even algorithm using Python. I flattened the image pixel value array using numpy and reserved first few bits to store the length of the message. The length of the message is a key to encrypt and decrypt. Data bits are encoded after the reserved bits.
For encryption, I converetd the text message to ASCII code and then matched the pattern in the image pixels values e.g. if the text code is 01100001 then I checked pixel value of image of eight pixels and ensured that it has even value if the text corresponding code is 0 and odd if 1, in case it is not then I changed it to match. Thus, pixels values after encryption shold be even, odd, odd, even, even, even, even, odd. Changing pixel value by one has no visual impact on the image.
For decryption, I first checked the reserved pixels to get the length of the message and then checked the pixel values for odd/even from the starting position of data pixels and until message length.