Iv a DUAL-WATERMARKING with QR CODE AGAINST CROPPING
Total Page:16
File Type:pdf, Size:1020Kb
View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by UTHM Institutional Repository iv A DUAL-WATERMARKING WITH QR CODE AGAINST CROPPING AND RESIZING ATTACK LAU WEI KHANG A dissertation submitted in fulfillment of the requirement for the award of the Degree Master’s of Computer Science (Information Security) Faculty of Computer Science and Information Technology Universiti Tun Hussein Onn Malaysia January 2016 viii ABSTRACT Watermarking is a pattern of bits inserted into a digital image, audio or video file (digital file) that identifies the file’s ownership copyright information. It is one of the techniques to discourage illegal duplication of intellectual property. However, there is still a room for improvement for new techniques applied to digital files to withstand against cropping and resizing attack. In this Dual-watermarking with QR code project, both visible and invisible watermark are used. The proposed technique is compared with MOHANTY and HSU & WU techniques. First, visible QR code watermark is embedded into the image using LSB 7 (embed at the 7th bit from the left of the binary number) technique. Then, the invisible QR Code watermark was embedded into image using LSB 1 (embed at the 1st bit from the left of the binary number) technique. The proposed technique shows the watermark can be successfully extracted when image is enlarged up to 90 percent or shrank up to 90 percent (resizing attack). If enlarging and shrinking are combined to the same watermarked image, watermark can still be extracted and scanned. Final result for cropping attack shows that watermark can be successfully extracted when image is cropped up to 36 percent. If it is more than 36 percent, watermark is extractable but can not be scanned by QR Code scanner device. Besides that, PSNR result also shows that the proposed technique DWQR is 15 percent better than HSU & WU technique. ix ABSTRAK Watermarking merupakan salah satu corak yang memasukkan bits ke dalam satu imej digital, fail bunyi atau video yang dapat mengenal pasti maklumat tentang hak cipta pemilik. Ia merupakan salah satu teknik untuk mengelakkan pertindihan harta intelek daripada seseorang. Walau bagaimanapun, masih terdapat ruang untuk penambahbaikan bagi teknik-teknik baru untuk menahan serangan pengubahan saiz imej (resizing attack) dan serangan pangkas (cropping attack). Dalam projek Dual- Watermarking with QR code ini, watermark yang ketara (visible watermark) dan watermark yang tersembunyi (invisible watermark) telah digunakan. Teknik yang dicadangkan telah dibandingkan dengan teknik MOHANTY dan teknik HSU & WU. Pertama, watermark kod QR yang ketara ditanam ke dalam imej dengan menggunakan teknik LSB 7 (tanam pada bit ketujuh dari kiri nombor binari). Kemudian, watermark kod QR yang tersembunyi ditanam juga ke dalam imej dengan menggunakan teknik LSB 1 (tanam pada bit pertama dari kiri nombor binari). Hasil kajian menunjukkan bahawa teknik yang dicadangkan menunjukkan bahawa watermark berjaya dikeluarkan apabila imej dibesarkan sehingga sembilan puluh peratus atau disusut sehingga sembilan puluh peratus. Jika teknik membesar dan menyusut digabungkan pada imej yang sama, maka watermark masih boleh dikeluarkan dan diimbas. Watermark berjaya dikeluarkan apabila imej diserang dengan serangan pangkas sehingga tiga puluh enam peratus. Jika melebihi tiga puluh enam peratus, watermark masih boleh dikeluarkan tetapi kod QR tidak dapat diimbas oleh peranti imbasan. Selain itu, hasil PSNR menunjukkan teknik Dual- Watermarking with QR code lima belas peratus lebih baik daripada teknik HSU & WU. x TABLE OF CONTENTS DECLARATION ii DEDICATION iii ACKNOWLEDGEMENT iv ABSTRACT v ABSTRAK vi TABLE OF CONTENTS vii LIST OF TABLES x LIST OF FIGURES xi LIST OF ABBREVIARIONS xiii LIST OF APPENDICES xiv CHAPTER 1 INTRODUCTION 1.1 Overview 1 1.2 Problem Statement 2 1.3 Project Aim 3 1.4 Objectives 3 1.5 Scope 4 1.6 Contribution 4 CHAPTER 2 LITERATURE REVIEW 2.1 Introduction 5 2.2 Digital Watermarking 5 2.2.1 Visible Watermarks 10 2.2.2 Invisible Watermark 11 2.2.3 Public Watermark 11 2.2.4 Fragile Watermark 11 2.2.5 Private Watermark 12 xi 2.2.6 Perceptual Watermarks 12 2.2.7 Bit-stream Watermarking 12 2.2.8 Text Document Watermarking 12 2.3 QR Code 13 2.3.1 QR Code Model 1 16 2.3.2 QR Code Model 2 17 2.3.3 Micro QR code 17 2.3.4 iQR Code 18 2.3.5 SQRC 19 2.3.6 Logo Q 20 2.4 Image File Types 20 2.4.1 JPEG 21 2.4.2 TIFF 21 2.4.3 RAW 22 2.4.4 GIF 22 2.4.5 BMP 23 2.4.6 PNG 23 2.5 Dual-watermark Techniques 24 2.5.1 MOHANTY Dual-watermarking Technique 24 2.5.2 HSU & WU Dual-watermarking with QR Code Technique 25 2.5.3 Comparison of Technique 27 2.6 Summary 28 CHAPTER 3 METHODOLOGY 3.1 Introduction 29 3.2 The Proposed Framework 29 3.2.1 Visible Watermarking of the Image 33 3.2.2 Invisible Watermarking with Embedded QR Code of the Image 34 3.2.3 Extracts QR Code from Dual-Watermarked Image 35 3.3 Method of Validation 36 3.4 Comparison with Other Techniques 36 3.5 Summary 37 xii CHAPTER 4 IMPLEMENTATION 4.1 Introduction 38 4.2 Implementation Phase 38 4.2.1 Proposed Framework Flowchart 39 4.2.2 QR Code Generation 44 4.2.3 LSB Based Visible Watermark Function 46 4.2.4 LSB Based Invisible Watermarking Function 48 4.2.5 Watermark Extract Function 51 4.3 Summary 54 CHAPTER 5 EXPERIMENTATION AND RESULT 5.1 Introduction 55 5.2 Resizing Attack 55 5.2.1 Test on Resizing Attack 56 5.2.2 Result of Resizing Testing 65 5.3 Cropping Attack 66 5.3.1 Test on Cropping Attack 66 5.3.2 Result of Cropping Attack 70 5.4 Peak Signal-to-noise Ratio (PSNR) 71 5.4.1 PSNR Test 71 5.4.2 Result of PSNR Test 73 5.5 Summary 74 CHAPTER 6 CONCLUSION AND FUTURE WORKS 6.1 Introduction 75 6.2 Limitations 75 6.3 Future Works 76 6.4 Conclusion 77 REFERENCES 78 APPENDICES A 81 VITA 83 xiii LIST OF TABLE 2.1 Weaknesses of MOHANTY and HSU & WU technique 27 3.1 Comparison of Dual-Watermarking technique 31 3.2 Comparison of related work 37 4.1 Extracted watermark from four watermarked cover image 53 5.1 Result of enlarging 56 5.2 Results of shrinking 58 5.3 Cover image : baboon512 Watermark image : UTHM_L 59 5.4 Cover image : baboon512 Watermark image : UTHM_M 60 5.5 Cover image : baboon512 Watermark image : UTHM_Q 60 5.6 Cover image : baboon512 Watermark image : UTHM_H 60 5.7 Cover image : lena512 Watermark image : UTHM_L 61 5.8 Cover image : lena512 Watermark image : UTHM_M 61 5.9 Cover image : lena512 Watermark image : UTHM_Q 61 5.10 Cover image : lena512 Watermark image : UTHM_H 62 5.11 Cover image : pepper512 Watermark image : UTHM_L 62 5.12 Cover image : pepper512 Watermark image : UTHM_M 62 5.13 Cover image : pepper512 Watermark image : UTHM_Q 63 5.14 Cover image : pepper512 Watermark image : UTHM_H 63 5.15 Cover image : UTHM512 Watermark image : UTHM_L 63 5.16 Cover image : UTHM512 Watermark image : UTHM_M 64 5.17 Cover image : UTHM512 Watermark image : UTHM_Q 64 5.18 Cover image : UTHM512 Watermark image : UTHM_H 64 5.19 Results of cropping attack based on cropping percentage 67 5.20 Results of random cropping attack 69 5.21 PSNR of each cover image with watermark image 72 5.22 Comparison between Dual-Watermarking and HSU & WU technique based on PSNR 73 xiv LIST OF FIGURES 2.1 Fifty percent visibility of watermark 6 2.2 Hundred percent visibility of watermark 6 2.3 Classification of watermarks 9 2.4 Watermark embed spatial domain watermarking 10 2.5 Watermark extraction spatial domain watermarking 10 2.6 QR Code versus Barcode 14 2.7 QR Code modules 14 2.8 Version of QR Code 15 2.9 QR Code Model 1 with 73 × 73 modules 16 2.10 QR Code Model 2 with 177 × 177 modules 17 2.11 Micro QR Code that required one position detection pattern 17 2.12 Comparison of data size between QR Code, Micro QR Code and Barcode 18 2.13 Storage increase 80 percent than a regular QR Code 19 2.14 Smaller footprint is required to compare with regular QR Code 19 2.15 QR Code embedded with letters and color to create Logo Q 20 2.16 The flowchart of HSU & WU technique 26 2.17 The flowchart of watermark removing algorithm 26 3.1 Proposed framework of Dual-Watermarking with QR Code 32 3.2 Schematic of the proposed Dual-Watermarking with QR Code 32 3.3 Function E for encode visible watermark into raw image 33 3.4 QR Code that same size with watermarked image (I’ ) 34 3.5 Function E that encode invisible watermark ( Q ) and resulting (I’’) 35 3.6 Function D that decode (I’’) into (I’ ) and QR Code ( Q ) 36 4.1 Flowchart of Dual-Watermarking with QR Code 39 4.2 Flowchart to generate a watermark QR Code 40 4.3 Flowchart for visible watermark embedding 41 4.4 Flowchart for invisible watermark embedding 42 xv 4.5 Flowchart for invisible watermark extracting 43 4.6 Call function for QR Code generator 44 4.7 Version mode for QR Code generator 44 4.8 Function mode for QR Code generator 45 4.9 Partial code for maximum data input 45 4.10 Graphic user interface for QR Code generator 46 4.11 Partial code for LSB based visible watermarking process using MATLAB 47 4.12 Watermarked image I’ 48 4.13 Partial code that read both watermarks image and cover images 48 4.14 Partial code for checking the size of watermark image and cover image using MATLAB 49 4.15 Algorithm calculation for LSB based invisible watermarking process using MATLAB 50 4.16 Partial code for saving and display the watermarked image using MATLAB 50 4.17 Watermarked image I’’ 51 4.18 Partial code for watermark extracts function 52 4.19 Watermark (QR Code) extracted from watermarked image I’’ 52 5.1 Watermarked image was divide into 25 parts which was 4 percent of each part by using