LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-01-2015, 03:18 PM   #1
Sanpreet Singh
Member
 
Registered: Jan 2013
Location: Malout,Punjab
Distribution: Ubuntu(Debian),
Posts: 40
Blog Entries: 1

Rep: Reputation: Disabled
Attacks on Watermarked Image


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.
Attached Thumbnails
Click image for larger version

Name:	Barberra+Oin.png
Views:	39
Size:	179.8 KB
ID:	18329   Click image for larger version

Name:	Fruits+SecretMessage+Salt and pepper.jpg
Views:	35
Size:	68.1 KB
ID:	18330  

Last edited by Sanpreet Singh; 05-01-2015 at 03:44 PM.
 
Old 05-04-2015, 12:45 PM   #2
SoftSprocket
Member
 
Registered: Nov 2014
Posts: 399

Rep: Reputation: Disabled
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.
 
1 members found this post helpful.
Old 05-04-2015, 11:00 PM   #3
Sanpreet Singh
Member
 
Registered: Jan 2013
Location: Malout,Punjab
Distribution: Ubuntu(Debian),
Posts: 40

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Ok Sir. Next time I will make care of it. I am using MATLAB
 
Old 05-05-2015, 06:31 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by Sanpreet Singh View Post
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/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] May I ask here who made this AWS AMI image for slackware? kite Slackware 5 01-26-2013 12:17 PM
What is the easiest way to increase the size of a Xen Image made from an image? abefroman Linux - Software 4 12-14-2009 10:11 PM
How to resize vfat disk image made with dd lindylex Linux - Software 4 03-05-2009 10:25 PM
Automatic image scaling down xzc Linux - Software 3 04-01-2006 10:52 AM
scaling background image - Slackware, WindowMaker itsjustme Slackware 5 08-11-2003 04:27 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration