LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Attacks on Watermarked Image (https://www.linuxquestions.org/questions/programming-9/attacks-on-watermarked-image-4175541351/)

Sanpreet Singh 05-01-2015 03:18 PM

Attacks on Watermarked Image
 
2 Attachment(s)
I am doing a project on Image watermarking using Discrete Wavelet Transform(DWT) and Encryption. It is carried out in the following steps
1.) Select the host image( Image in which watermark will be hided).
2.) Select the watermark.
3.) Encrypt the watermark using the following code
b= strcat(b,a); String Concatenation
c=imread(b); Image is read and stored in the variable c
[p,q,r]=size(c); %displaying the dimensions of Image
%%%%%%%%%Cipher watermark%%%%%%%%%%%%%%%%%%%%%
scrambleOrder = randperm(p*q); %this is a ranperm method which generated random values
redChannel = c(:, :, 1); %Extarction of red channel
greenChannel = c(:, :, 2); %Extarction of green channel
blueChannel = c(:, :, 3); %Extarction of blue channel
redChannel = redChannel(scrambleOrder); %Red channel will be given random values as generated above
greenChannel = greenChannel(scrambleOrder); %Green channel will be given random values as generated above
blueChannel = blueChannel(scrambleOrder); %Blue channel will be given random values as generated above
redChannel = reshape(redChannel, [p,q]); %reshaping red channel as given by (p and q)
greenChannel = reshape(greenChannel, [p,q]); %reshaping green channel as given by (p and q)
blueChannel = reshape(blueChannel, [p,q]); %reshaping blue channel as given by (p and q)
s = cat(3, redChannel, greenChannel, blueChannel); %displacing rgb channel collectively

4.) Watermarking using DWT.

5.) Recover the Encrypted watermark using recovery formula.

6.) Decryption of watermark using the following code.
recoverOrder = zeros([u*v], 2); %it will generate the 2 columns having maximum value u*v and where u and v are dimensions(width and height) of recoverd watermark from watermarked image.
recoverOrder(:, 1) = 1 : (u*v); %make the first coluns value from 1: u*v
recoverOrder(:, 2) = scrambleOrder; %make second column value od randon permutaion generated during encryption
newOrder1 = sortrows(recoverOrder, 2); %sort rows of column1 and column 2
newOrder = newOrder1(:,1); Eliminate column2
redChannel = redChannel(newOrder); %New order value into red channel
greenChannel = greenChannel(newOrder); %New order value into green channel
blueChannel = blueChannel(newOrder); %New order value into blue channel
redChannel = reshape(redChannel, [u, v]); %reshape red channel
greenChannel = reshape(greenChannel, [u, v]); %reshape green channel
blueChannel = reshape(blueChannel, [u, v]); %reshape blue channel
D = cat(3, redChannel, greenChannel, blueChannel); %cat RGB and store it in D

My Question is that I have made many attacks on Watermarked Image like Rotation, Scaling, Croping but PSNR and MSE between (Watermark and Decrypted watermark) after and before attack remain Infinity and Zero respectively.

I think During Decryption, I have used same ran permutation that I used to ENCRYPT the image. So I think, Attacks have no effect on decrypted image.

Question is how to improve my code or what suggestions you can give me.

I have uploaded 2 Images. Here all can see that even on crping or adding noise, Decrypted image is not effected.

I am trying my hard. I guess getting suggestion can help me a lot.

SoftSprocket 05-04-2015 12:45 PM

My suggestion is with regards to posting style.

First and foremost, tell people what language you are using. I'd guess MATLAB?

Secondly, use the [code][/code] tags for your code. It will preserve formatting and make it far easier to read.

Thirdly, if you have a question make it clear. This, "My Question is that I have made many attacks on Watermarked Image like Rotation, Scaling, Croping but PSNR and MSE between (Watermark and Decrypted watermark) after and before attack remain Infinity and Zero respectively", is not a question.

Sanpreet Singh 05-04-2015 11:00 PM

Ok Sir. Next time I will make care of it. I am using MATLAB

rtmistler 05-05-2015 06:31 AM

Quote:

Originally Posted by Sanpreet Singh (Post 5358015)
Ok Sir. Next time I will make care of it. I am using MATLAB

I guess this is your idea of taking care of it to make it more clear, cross post in another forum with even less information. This would be the correct forum, programming versus Newbie.

Once again, re-read LQ Rules and do not cross post.

http://www.linuxquestions.org/questi...ng-4175541593/


All times are GMT -5. The time now is 12:19 PM.