简单/基本隐写算法和方法 [英] Simple/Basic steganography algorithms and methods

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

问题描述

什么是基本的和simpliest 隐写算法和方法?

我的意思是应用于图象的隐秘。

如何隐藏数据,图像的简单程序工作?什么是使用的主要技术?程序如何识别图像中的加密信息,而不对源图像?

解决方案
  

什么是基本的和simpliest隐写算法和方法?我的意思是应用于图象的隐秘。

我在过去写了一个库,这是很久以前的,所以我可以形容这个过程。

基本上,如果你有一个文件格式,让我们说,24位BMP格式。首先,你需要一种方法来读取和写入的像素到该文件格式。要么你可以使用库或编写自己的,一旦你学会了什么文件格式。

这是图像可以被看作是一系列的像素。考虑一个4×4像素的图像:

  

X X X X
  X X X X
  X X X X
  X X X X

号这些像素从1到16:

  

01 02 03 04
  05 06 07 08
  09 10 11 12
  13 14 15 16

这上面的编号为每个像素具有一个红色分量,一个绿色分量和蓝色分量。每个组件的各自是1个字节,因此每个组件可以在被看作为0〜255(24位= 8位红色,8位绿色,8位蓝色)的值。所以,每一个数字以上的有0 3个值的集合到255

因此​​,在用4×4图像上面的例子中你共有16pixels的* 3​​color_components = 48字节中的图像数据。通常你会做的是使用每种颜色分量为en $ C $只有至少显著位C图像。在这种情况下,你将不得不数据,为您提供48位位= 6个字节提供给您EN code任何你想要的6字节的消息。

要简化这一过程,虽然我们只是看看编码一个简单的3位消息到单个像素。而假设我们只使用每种颜色分量1位。 比方说,我们要连接code中的3位消息:111

下面是值像素的示例1 上面的面前,你的连接code中的数据:

R:10101011
G:11111010
B:00011010

你要做的就是改变只有最低显著位为新的数据:

R:1010101 1
G:1111101 1
B:0001101 1

像素将看起来是一样的人的眼睛,但现在你正在使用的最显著位重新present你想连接code中的数据。

如果你想连接code数据超过3位到单个像素也可以做到这一点。什么情况是,你将连接code不仅仅是至少显著位,您可以用最少的2显著位,或至少3个,等你用更多的位,你会开始看到的一点点在图像质量的差异。您可以使用多达7位,虽然和你的形象会看起来仍然辨认。

通常情况下,你将有大量的数据要超过3位的EN code虽然。要连接code中的数据越多,你将不得不要么有更多的像素,或使用每像素更多的比特EN code的数据。比方说,你有数据,你要到9位的EN code,以及如果你只使用最显著位,则需要3个像素EN code的信息。如果你想只用1个像素,虽然你可以通过使用每种颜色分量的3个最小显著位为en code的数据。

要做到这种类型的工作,你可能会想创造一些功能与数据的位数很容易的工作是抽象掉了处理不断有位操作的复杂性。

的技术将变化为不同的文件格式,但概念是相同的。隐写术也可以指只是为了隐藏的数据。例如在一个GIF扩展块均匀。通常情况下,你隐藏它虽然通过改变图像的像素,或者在某些文件格式的颜色查找表。

一些图像具有在头一个颜色查找表,然后将该像素是索引到那些颜色查找表。你可以做的是重新排序的颜色查找表,以便最相似的颜色接近,那么你就可以连接code数据双双进入颜色查找表本身,进入像素的索引。因为如果指数略有变化,因为查找表是根据被类似的有序都不会有问题。

您真的需要具备的文件格式的理解做这种类型的工作虽然。或至少​​是使用能够操纵文件格式和文件数据为您的库。如果您是这个话题很感兴趣,我建议使用类似BMP一个简单的文件格式并学习它。你总是可以找到的网站如 www.wotsit.org 文件格式规范。

  

程序如何识别加密的消息中没有图像源图像?

您是正确的。那日codeS的信息并不需要与源图像的程序。 这是如何工作的,它只是做相反的工作,该计划将需要知道数据有多少位,你enoded使用,并使用相同的脱code。它将简单地迭代的每个像素,并结合位成字节和写入这些字节出到文件

What are the basic and simpliest steganography algorithms and methods?

I mean the steganography applied to images.

How does simple program that hides data to images work? What are the main techniques used? How does the program recognize the encrypted message in image without the source image?

解决方案

What are the basic and simpliest steganography algorithms and methods? I mean the steganography applied to images.

I have written a library for this in the past a long time ago so I can describe the process.

Basically if you have a file format, let's say the 24-bit BMP format. First you need a way to read and write pixels into that file format. Either you can use a library or write your own once you learnt what the file format is.

An image can be looked at as a series of pixels. Consider a 4x4 pixel image:

x x x x
x x x x
x x x x
x x x x

Number these pixels from 1 to 16:

01 02 03 04
05 06 07 08
09 10 11 12
13 14 15 16

Each pixel that is numbered above has a red component, a green component and a blue component. Each of those components are 1 byte each and so each component can be looked at as a value of 0 to 255. (24-bit = 8bits for red, 8 bits for green, 8 bits for blue). So each of the numbers above have 3 sets of values from 0 to 255.

So in the above example with a 4x4 image you have a total of 16pixels*3color_components = 48 bytes of data in your image. Typically what you will do is use only the least significant bit of each color component to encode your image. In which case you would have 48 bits bits of data available for you = 6 bytes available to you to encode any 6 byte message you want.

To make this easier though let's just look at encoding a simple 3 bit message into a single pixel. And let's assume we are only using 1 bit per color component. Let's say we want to encode the 3 bit message: 111

Here is an example of the value pixel 1 above has before you encode the data:

R: 10101011
G: 11111010
B: 00011010

What you do is change only the least significant bit to the new data:

R: 1010101 1
G: 1111101 1
B: 0001101 1

The pixel will look the same to the human eye, but now you are using the least significant bit to represent the data you wanted to encode.

If you want to encode more than 3 bits of data into a single pixel you can also do that. What happens is that you will encode more than just the least significant bit, you can use the least 2 significant bits, or the least 3, etc. The more bits you use, you will start to notice a little bit of a difference in the image quality. You can use up to 7 bits though and your image will still look recognizable.

Typically you will have a lot more than 3 bits of data you want to encode though. The more data you want to encode, you will have to either have more pixels, or use more bits per pixel to encode the data. Let's say you have 9 bits of data you want to encode, well if you are only using the least significant bit, then you need 3 pixels to encode that information. If you want to only use 1 pixel though you can do that by using the 3 least significant bits per color component to encode that data.

To do this type of work you'll probably want to create some functions for easily working with bits of data that abstract away the complexities of dealing constantly with bitwise operators.

The technique will vary for different file formats, but the concept is the same. Steganography can also refer just to hiding the data for example in a GIF extension block even. Typically you hide it by varying the pixels of the image though, or in some file formats the color lookup table.

Some images have a color lookup table in the header, and then the pixels are indexes into those color lookup tables. What you can do is re-order the color lookup table so the most similar colors are close together, then you can encode data both into the color lookup table itself and into the indexes of the pixels. Because it won't matter if the index slightly changes because the lookup table is ordered according to being similar.

You really do need to have an understanding of the file formats to do this type of work though. Or at least be using a library that can manipulate the file format and file data for you. If you are really interested in this topic I suggest to start with a simple file format like BMP and to learn it. You can always find file format specifications on sites like www.wotsit.org.

How does the program recognize the encrypted message in image without the source image?

You are correct. The program that decodes the information does not need the source image. How this works is that it simply does the reverse, the program will need to know how many bits of data you enoded using and use the same to decode. It will simply iterate over each pixel and combine the bits into bytes and write those bytes out to a file.

这篇关于简单/基本隐写算法和方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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