hide numerical values in image
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
how to hide a matrix into an image and retrieve it.
i used the lsb code from the link
i can hide the data. But while retrieving i'm not able to recover the matrix values. Its coming as empty string values. Even the bitStream values when i convert to double is not coming correctly
How can i do it for numerical values.
채택된 답변
Image Analyst
2019년 2월 23일
0 개 추천
See my attached demo where I hide an image in another image and then recover it.
댓글 수: 13
Elysi Cochin
2019년 2월 24일
sir i went through your lsb codes, the one with visible watermarking also. But what if i want to store 2 images as same size of cover image
Walter Roberson
2019년 2월 24일
As I told you twice before it is not possible to hide two images the same size as the cover image both into the same lsb.
Consider the top left corner . Suppose it is 10010110 binary . Now suppose the bit for the first image is a 0, then you overwrite the 0 lsb with a 0 giving you 1001011|0 where here the bar is not there but just indicates that the 1001011- will be used from the cover image and that 0 from the first secret image is to be used.
Now suppose that the bit for the second secret image is 1. Now where are you going to put it? The top 7 bits cannot be affected because you are restricting yourself to lsb techniques . If you overwrite the 0 of 1001011|0 with the 1 of the second image then the 0 will not be there to be extracted afterwards .
LSB techniques cannot hide more total bits than the number of lsb bits, which is rows*columns . You are trying to hide rows*columns*2 bits.
Image Analyst
2019년 2월 24일
I guess maybe you could hide it in the image FILE but not the image, like for example if you made a custom TIFF tag and put the hidden image in that. No one would know it's there when they just do a simple display - you'd have to know that it was there and do special things to pull it out. Similar to an image hidden in the pixels - you have to do special things to pull it out.
Of course I don't know why this is even needed at all. If you want hidden things, then why not just encrypt them using normal encryption methods? True, someone might not know that you're hiding things with steganography like they would with a file encrypted normally, but is that any reason to use a less secure hiding method (I'm pretty sure steganography is much less secure than normal 128 bit encryption)
Elysi Cochin
2019년 2월 25일
Sir, do you have any example of how to make a custom TIFF tag and put the hidden image in that.
Image Analyst
2019년 2월 25일
No I don't. You can study up on the TIFF class in the MATLAB help and perhaps it will have methods there that will allow you to attach/insert a custom tag.
Elysi Cochin
2019년 2월 26일
If you want hidden things, then why not just encrypt them using normal encryption methods?
I tried some of the encryption methods available, but i'm not able to encrypt 2 images of same size into one, and retrieve it.
Actually i also want, to do a croping from the stegoImage and still, i should be able to extract both the hidden image.
Sir, i tried the example of tiff using colour image
tagstruct.ImageLength = size(imgdata,1)
tagstruct.ImageWidth = size(imgdata,2)
tagstruct.Photometric = Tiff.Photometric.RGB
tagstruct.BitsPerSample = 8
tagstruct.SamplesPerPixel = 3
tagstruct.RowsPerStrip = 16
tagstruct.PlanarConfiguration = Tiff.PlanarConfiguration.Chunky
tagstruct.Software = 'MATLAB'
its working fine for colour images. please can you help me with the changes i need to make for gray images
Its not RGB, is it Pallette
when i write as below it shows error
tagstruct.Photometric = Tiff.Photometric.Pallette
error
Reference to non-existent field 'Pallette'.
Error in demo_tif_my (line 13)
tagstruct.Photometric = Tiff.Photometric.Pallette
can you help me solve it out
Walter Roberson
2019년 2월 26일
Tiff.Photometric.Palette -- only one l
Note that Palette corresponds to pseudo-color images, where the value you write is not an intensity but is instead a color index. If you change a value that is a color index by 1 bit, you could end up with a visibly very different image, since it is possible for bright yellow and dull red to be right beside each other in a color map.
Grayscale images should have Tiff.Photometric.BlackIsMin . And remember to switch to SamplesPerPixel = 1 for grayscale.
Walter Roberson
2019년 2월 26일
Elysi:
Suppose I somehow hide a complete 768 x 480 grayscale image of The Mona Lisa into a cover image. Now suppose I crop down to one single pixel. Should I expect to be able to recover the complete Mona Lisa from the cropped image? Suppose I had cropped down to two pixels total: should I expect to be able to recover the complete Mona Lisa from the cropped image? Three pixels? What is the minimuma number of of pixels that we can crop down to and expect to recover the complete 768 x 480 Mona Lisa from?
Now suppose I had hidden a complete 768 x 480 grayscale image of The Mona Lisa into a cover image, and then I cropped down to the left half of that. You expect to be able to recover the complete Mona Lisa, so the complete Mona Lisa has to be hidden in the left half of the original. But you could have taken the right half instead and you expect to be able to recover the complete Mona Lisa from that, so a complete copy must be hidden there too. So you have to hide the Mona Lisa twice, once for left and once for right half. But we could have split top/bottom and you expect to be able to recover the complete Mona Lisa from those, so it follows that you have to hide the Mona Lisa four times, once for each quarter. But you could have chosen to crop into thirds, and you expect to be able to recover from those, so you have to hide the complete Mona Lisa nine times.
By extension, it follows that you have to hide a complete copy of the Mona Lisa in every pixel of the output image in order to meet your requirements.
Note that when people read in the TIFF image to crop it, it is rather unlikely that their process will happen to duplicate your custom TIFF tag. And cropping off custom TIFF tags is a valid "crop" attack.
Walter Roberson
2019년 2월 26일
In order to be able to put 2*n bits of information into n bits, you need some kind of compression routine which is able to compress by at least 2:1 .
For example if your cover image is not using lossy compression (that is, you are not storing as jpeg ) then you might be able to do Discrete Cosine (jpeg) compression of the images to be hidden , choosing a quality level that needs fewer than n/2 bits for each of the two images to hide, and embed the coefficients .
Sir @Walter Roberson,
You have asked me exactly what i wanted
"Suppose I somehow hide a complete 768 x 480 grayscale image of The Mona Lisa into a cover image. Now suppose I crop down to one single pixel. Should I expect to be able to recover the complete Mona Lisa from the cropped image?"
Yes, sir i should be able to recover it. I was asking this only, whether there is any method available.
Then as you said
"You expect to be able to recover the complete Mona Lisa, so the complete Mona Lisa has to be hidden in the left half of the original... hide the Mona Lisa four times, once for each quarter"
Sir, i was asking this only, whether there is any method so that i can hide my 2 images in any 2 quarter, and crop from other 2 quarters. Actually cropping from anywhere should not effect it. But is there any method where "i can hide my 2 images in any 2 quarter"
I opted for this tiff method because i didnt get a solution for hiding my 2 images of same size as cover image in the cover image. If any solution for saving it in quarter, it would be very helpful
Then from the tiff method, i did as below.
im = imread('subimage_file.tif');
im(50:100,50:100,:) = 255;
imwrite(im, 'subimage_file.tif');
But when i do then i cannot read the subdirectory images in the tiff image. Any solution for this? Or should i write it the other way using Tiff class then only i can read it?
Image Analyst
2019년 2월 27일
Elysi, as long as you don't crop off what you stored, you should be able to recover it. That is if you were able to store it. And storing two quarter sized full dynamic range images in a regular image without seeing it is not possible. You might try hiding an 8 bit image in the lower 8 bits of a 16 bit image.
And you'd need to use the tiff class to have any hope of storing a custom tag, but when your attacker reads it in, there is no guarantee that they will save your tag, in fact, probably won't, just like using imwrite() won't. So it would be easy for your attacker to read in, attack, and save back out, and then you would not be able to tell that that image was your forged/attacked image because your custom tiff tag if no longer there.
Elysi Cochin
2019년 2월 28일
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Images에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
