Steganography with FME
From fmepedia
Have a look at these two images, and try to find any difference:
| Image 1 | Image 2 |
|---|---|
![]() | ![]() |
I don't think there is anything visibly different between these pictures. Let's pass, however, the images (Image 1, Image 2) through the Decipherer workspace:
Basically, what the expression if(A[0]-B[0]==0,255,0) in RasterExpressionEvaluator says is "if there is no difference between corresponding pixels of two images, make a new pixel white, otherwise make it black".
The output will reveal a hidden text within the second image:
Of course, you can use something boring as your secret message - "this image is property of...", or "all rights reserved", or "this image is stolen from the personal collection of..."
This is an example of steganography (http://en.wikipedia.org/wiki/Steganography). Wikipedia defines it as "An art and science of writing hidden messages in such a way that no one, apart from the sender and intended recipient, suspects the existence of the message."
To encipher this secret message, we use another workspace:
The workspace makes a text placed somewhere within raster - note that the text does not use Coordinate System, it is placed in pixel coordinates. By doing this, we avoid the necessity to know and adjust our text to ground units. The text is rasterized within ImageRasterizer, which also uses some parameters extracted from the source raster (extents and row/column numbers). The last step is enciphering itself made with RasterExpressionEvaluator:
if(B[0]!=0,A[0]+1,A[0]);if(B[0]!=0,A[1]+1,A[1]);if(B[0]!=0,A[2]+1,A[2])
The expression tells to change slightly (by 1) the source raster whenever the pixels of the second raster are not zero. For example, if we modify a pixel that had its RGB values at 156, 123, 65, the new pixel will get 157, 124, 66. The illustration below shows these two colors together:
You can hide your own message by pressing Ctrl+R in the Encipherer workspace - you will be asked to enter your message and font size in pixels. Don't forget to download the source image or use your own.
This method can be useful for watermarking images. Note, however, using lossy compressions will destroy hidden message - this type of compression requires more sophisticated algorithm of watermarking.


