Question
Implement LSB replacement. Your goal for this problem is to generate a stego image using LSB replacement. What to submit: a function m-file that has
Implement LSB replacement. Your goal for this problem is to generate a stego image using LSB replacement. What to submit: a function m-file that has form: function [stego] = embedLSB(imagepath, payloadlength) where imagepath is a path to an image file on the computer; payloadlength is 50 or 75. For the output, stego is the resulting stego image. Please submit a separate script file to run it. (a) Create an array M the same size as the image. The matrix M will hold the payload or message bits. Generate random 0s and 1s and store them in the matrix M. Then, embed the top half of the matrix M into the first 50% of the least significant bits of the cover image, lexicographically (row-wise: left to right, top to bottom of the array, or column-wise: top to bottom, left to right). This produces a stego image call it stego2a.png - whose payload is contained in the first 50% of the bits of the cover image. (The remaining gray values of the stego image are the same as the cover image.) (b) For the second experiment, do as in part (a), but use 75% of M. Embed the top of M into the cover image, lexicographically. This produces a stego image call it stego2b.png - whose payload is contained in the first 75% of the bits. a. What percentage of ones and zeros are in the LSB plane of the original cover image you used? b. What percentage of ones and zeros are in the LSB plane of the matrix M? c. What percentages of ones and zeros are in the top half of M that was written to stego2a.png? d. What percentages of ones and zeros are in the top half of M that was written to stego2b.png?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started