图像中的隐写术 [英] Steganography in image

查看:276
本文介绍了图像中的隐写术的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我已经在十六进制编辑器中打开了图像并查看了字节。然而,对于我的生活,我无法识别声音。我花了好几天时间。我甚至尝试在Audacity中打开文件(作为原始数据)并播放它。只有'噪音'。尝试创建直方图/频率分析,但没有。

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.

推荐答案

隐写术通常通过将第二个图像或某些数据隐藏在另一个图像的低位来工作。总体而言,这些值变得非常微不足道,并且对图像的视觉外观几乎没有影响。

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)

      等。

      如果没有这些信息它就没用了(你可以尝试猜测,但他们会猜测,你可以做很长时间)。

      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:

      以下是使用预先知道的图像隐藏另一个图像(猫)的低级2位的结果:

      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);
      }

      随附图像你会得到一些看起来像噪音的东西,但这并不重要,因为音频数据在任何情况下都会产生噪音图像 - 你现在的挑战是从这种噪音(或噪音)中做出任何事情:

      With the supplied image you will get something that looks like noise, but that doesn't matter so much as audio data would produce a noise image in any case - your challenge now is to make anything out of this noise (or "noise"):

      var img = new Image;
      img.onload = unstegano;
      img.crossOrigin = "";
      img.src = "//i.imgur.com/IpaDzB4.png";
      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++] & 1)<<7;  // masks first bit, shifts it to scale it
            data[i] = (data[i++] & 1)<<7;
            data[i] = (data[i++] & 1)<<7;
            i++
        }
        ctx.putImageData(idata, 0 ,0);
        document.body.appendChild(canvas);
      }

      这篇关于图像中的隐写术的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆