Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
429 views
in Technique[技术] by (71.8m points)

audio - Steganography in image

So far, I have opened the image in a hex editor and looked at the bytes. However, for the life of me I cannot identify the sound. I have spent days over this. I even tried opening the file (as 'Raw Data') in Audacity and playing it. Nothing but 'noise'. Tried to create a histogram/frequency analysis but nothing.

Any help would be appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Steganography usually works by hiding a second image or some data in the lower bits of another image. These values becomes very insignificant over-all and have little impact on the visual look of the image.

To reveal this second data, you mask off the top bits, then usually scale up remaining values.

However, you need to know in advance:

  • How many of the lower bits are used (two are very common for secondary images)
  • How is the remaining data organized (if not an image):
    • Is it (bit) scaled, how much
    • what order (scan-lines horizontally, vertically...).
    • Are all color components in use? Which one and how is the data split over the components...
    • Is it an audio file or audio data
    • Is the resulting data compressed, encrypted, ...
    • Audio requires signed values, are the values signed in the data, are they shifted... (this steals one bit which means the bytes must probably be packed to produce something audible)

etc.

Without this information it is pretty useless (you can try likely guesses but they will be guesses, and you can do this for a very long time).

In any case, I provided a basis below showing the process, but what remains, and if it is extracted correctly, is virtually "impossible" to determine without knowing how the original data is organized:

Here is the result of this process using an image which is known in advance to hide another image (the cat) in the lower 2 bits:

var img = new Image;
img.onload = unstegano;
img.crossOrigin = "";
img.src = "//i.imgur.com/DkCZMJN.png";  // contains a hidden image

document.body.appendChild(img);

function unstegano() {
  var canvas = document.createElement("canvas"),
      ctx = canvas.getContext("2d");
  
  canvas.width = this.naturalWidth;
  canvas.height = this.naturalHeight;
  ctx.drawImage(this, 0, 0);
  
  // get pixels
  var idata = ctx.getImageData(0, 0, canvas.width, canvas.height),
      data = idata.data, i = 0, len = data.length;
  
  while(i < len) {
      data[i] = (data[i++] & 3)<<6;  // masks two first bits, shifts it to scale it
      data[i] = (data[i++] & 3)<<6;
      data[i] = (data[i++] & 3)<<6;
      i++
  }
  ctx.putImageData(idata, 0 ,0);
  document.body.appendChild(canvas);
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...