Clear Filters
Clear Filters

Stegnography embedding image to bit conversion?

1 view (last 30 days)
how to convert image into bits? since I want to replace the pixels of the image(in bits) by the secret message in bits.

Answers (2)

Geoff Hayes
Geoff Hayes on 14 Mar 2015
Sandeep - use any of the bit-wise operators to manipulate the (presumably LSB) bits of the image pixels so that you can hide the secret message within them.
  1 Comment
Sandeep B
Sandeep B on 15 Mar 2015
Hi, Actually am trying to implement this below algorithm.
Its encoding phases are as follows, and am not able to get exactly how it can be done. Can you pls guide me?
it is as follows:
Step 1: Covert the message into bits. Here length of message bits used as key.
Step 2: Count the number of 1’s in the sample host image, n.
Step 3: If n is greater than or equal to one and less than number of all the bits of the stego sample, then it is a candidate for bit embedding otherwise ignore the sample
Step 4: Calculate p = (n+Sk) mod 8, here Sk means the secret key and 8 is the number of bits in one pixel.
Step 5: Calculate r=hp xor mb (hp= bit of the host sample in position p and mb is the message bit to embed)
Step 6: If r is equal to zero then need not modify and adjust the bit of the sample otherwise change hp by mb and adjust a near bit that is equal tomb by altering it.
Step7: Repeat the steps 2 to 6 until all the bits of the message is completed to embed.

Sign in to comment.


Image Analyst
Image Analyst on 15 Mar 2015
See my demo on LSB watermarking, attached below the demo it makes.
  2 Comments
Sandeep B
Sandeep B on 15 Mar 2015
Hi, Actually am trying to implement this below algorithm.
Its encoding phases are as follows, and am not able to get exactly how it can be done. Can you pls guide me?
it is as follows:
Step 1: Covert the message into bits. Here length of message bits used as key.
Step 2: Count the number of 1’s in the sample host image, n.
Step 3: If n is greater than or equal to one and less than number of all the bits of the stego sample, then it is a candidate for bit embedding otherwise ignore the sample
Step 4: Calculate p = (n+Sk) mod 8, here Sk means the secret key and 8 is the number of bits in one pixel.
Step 5: Calculate r=hp xor mb (hp= bit of the host sample in position p and mb is the message bit to embed)
Step 6: If r is equal to zero then need not modify and adjust the bit of the sample otherwise change hp by mb and adjust a near bit that is equal tomb by altering it.
Step7: Repeat the steps 2 to 6 until all the bits of the message is completed to embed.
Image Analyst
Image Analyst on 15 Mar 2015
Look into functions mod(), xor(), and dec2bin().

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!