!!!This content has not been translated yet!!!
annemden ve çocukluğumdan hatıra,
iki yalnız dev yatıyor orada...
 
 

Steganography PDF Print E-mail
Pazar, 18 Haziran 2006

Assume that we have a text of n characters and in this text each character is represented by 1 byte. If we want to hide this text into an image, we can use that human eye cannot realize small differences between colors. When we change the least significant bit of each byte in our image, human eye can not be able to realize the difference. So we can hide 1 bit information in each byte of the image. So that we should locate every 1 byte (8 bits) in the text into 8 bytes in the image bit by bit. Eventually we can hide a text of n characters into an image of at least 8*n characters. So we can hide ║m/8║ characters into an image of m bytes. Algorithm of this process is below.

  1. 1)i = 0
  2. 2)p = 0
  3. 3)if i = n then stop
  4. 4)j = 7
  5. 5)read i. byte from the text
  6. 6)shift 1 bit right the byte read
  7. 7)AND width 0x01
  8. 8)if the result is 0x01 then OR the p. byte of the image with 0x01
  9. 9)otherwise AND the p. byte of the image with 0xfe
  10. 10)p = p+1
  11. 11)j = j-1
  12. 12)if j = -1 then i = i+1, go to 3
  13. 13)go to 5

The C code which implements this algorithm is like this:

p = 0;
for(i=0; i {
for(j=7; j>=0; --j)
{
oku = yazi[i];
oku >>= j;
oku &= 0x01;
if(oku == 0x01)
Resim[p] |= 0x01;
else
Resim[p] &= 0xfe;
p++;
}
}

The algorithm to extract the information hidden in the image is below:

  1. 1)i = 0
  2. 2)p = 0
  3. 3)if i = n then stop
  4. 4)set i. character of the text to 0
  5. 5)j = 7
  6. 6)read p. byte from yhe image
  7. 7)AND with 0x01
  8. 8)shift left j bit
  9. 9)OR the i. character of the image with this result
  10. 10) p = p+1
  11. 11) j = j -1
  12. 12) if j = -1 then i = i+1 , go to 3
  13. 13) go to 6

The C code which implements this algorithm is like this:

p = 0;
for(i=0; i {
yazi[i] = 0;
for(j=7; j>=0; --j)
{
oku = Resim[p];
oku &= 0x01;
oku <<= j;
yazi[i] |= oku;
p++;
}
}

Fehmi Can SAGLAM
02.05.2004

 
Creative Commons License
programmer: n. an organism that turns caffeine into software.
original solarflare design by rhuk
lunarized by joomlashack

My computer geek score is greater than 100% of all people in the world! How do you compare? Click here to find out!