Sei sulla pagina 1di 52

CHAPTER 1 INTRODUCTION

1.1 Overview of the Project OBJECTIVE A novel framework for lossless (invertible) authentication watermarking, which enables zero-distortion reconstruction of the un-watermarked images upon verification has been proposed as opposing the earlier lossless authentication methods that required reconstruction of the original image prior to validation. The new framework allows validation of the watermarked images before recovery of the original image. A digital signature is a data string which associates (binds) a piece of information (in digital form) with some originating entity, Image authentication in traditional manner requires the storage and transmission of signature strings in the image header. This method imposes limitations on the image/file format sometimes preventing implementation in legacy systems. It is also susceptible to loss during format conversionseven if the underlying image data remains intact. It is therefore desirable to include the digital signatures within the image data. This goal can be achieved using watermarks, which exploit the redundancy in the image data and the insensitivity of the human visual system (HVS) to small distortions.

NOVEL LOSSLESS AUTHENTICATION FRAMEWORK The concept of using a lossless data embedding method for authentication watermarking has been proposed commonly referred as invertible or reversible authentication. All these methods are based on calculating the authentication information, and inserting this information using a lossless (reversible) data embedding method. The authentication information may be a hash, message authentication code, or digital signature computed over the un-watermarked image. The methods are differentiated by the particular reversible data embedding scheme used. In particular substituting least significant bit (LSB) plane(s) of the image by a bit-string containing the authentication information and the compressed form of the original LSBs. In this method, additional capacity is created through the lossless compression of the LSBs, which also allows for reconstruction of the original LSBs, thus the original image. This method is later replaced with the RS-Embedding scheme, which improves the capacity or equivalently reduces the embedding distortion in comparison with the earlier method for data embedding. Reversibility of the scheme is guaranteed through the use of modulo arithmetic. In his method, called difference expansion, detail coefficients of the transform are modified in an invertible manner. In these methods, the integrity and authenticity of the image is verified by i) extracting the embedded authentication information, ii) reversing.

LOCALIZED LOSSLESS AUTHENTICATION WATERMARK (LAW) In Localized Lossless Authentication Watermark or Localized LAW the hierarchical authentication watermark in conjunction with the lossless generalized-LSB data embed-ding algorithm. The hierarchical authentication watermark is a secure extension and provides excellent tamper localization accuracy with the ability to employ public key authentication scheme,. Hierarchical authentication watermark is inserted by i) setting LSBs of selected pixels to zero ii) dividing the image into blocks in a multi-level hierarchy iii) computing the digital signature or the message authentication code of each block; iv) rearranging these signatures according to their position in the hierarchy and v) replacing the LSBs of selected pixels by the signatures. Tamper localization is provided by the block-based nature of the algorithm as in the original .The Lossless Generalized-LSB data embedding algorithm10, 11 is a reversible data embedding algorithm which is similar to LSB-plane embedding. In this method, the lowest levels (bit-planes) of the pixel values are replaced with their compressed description and additional watermark payload. The particular compression mechanism exploits the correlation between different bit-planes and neighbouring pixels by utilizing the higher pixel levels as side information. Very good compression efficiency is achieved through prediction, context modeling and adaptive arithmetic coding. The loss of signal fidelity can be remedied by the use of lossless (also referred as reversible, invertible, or distortion-free) authentication watermarks, these methods, like their lossy counterparts, insert authentication information by modifying the host signal, thus induce an embedding distortion. Nevertheless, they also enable the removal of such distortions and hence exactlossless restoration of the original host signal.

Implementation of Localized LAW supports the following functionality 1) A secure, well-known public key authentication of the watermarked image. 2) Exact (lossless) recovery and authentication of the original unwatermarked image. 3) Low embedding distortion, through the use of Lossless G-LSB method. 4) Reduced computational requirements, when the image is not authentic/ watermarked. 5) Private key tamper localization ability. 6) Public validation (authentication) with private recovery using a single digital signature. Definitions Data-hiding Data-hiding is a technique used to embed a sequence of bits in a host image with small visual deterioration and the means to extract it afterwards. Authentication Watermark Watermarks that are easily corrupted by any image manipulation are classified as fragile or authentication watermarks. Cryptography The process of converting data into a secret code for transmission over a public network known as cryptography. The original text, or "plaintext," is converted into a coded equivalent called "cipher text" via an encryption algorithm. The cipher text is decoded (decrypted) at the receiving end and turned back into plaintext.

Authentication To verify the identity of a user logging onto a network known as Authentication. Passwords, digital certificates, smart cards and biometrics can be used to prove the identity of the client to the network. Digital Signature A digital signature is an electronic signature that can be used to authenticate the identity of the sender of a message or the signer of a document, and possibly to ensure that the original content of the message or document that has been sent is unchanged. Digital signatures are easily transportable, cannot be imitated by someone else, and can be automatically time-stamped. Digital Signature algorithm A DS algorithm is used by a signatory to generate a digital signature on data and by a verifier to verify the authenticity of the signature. Each signatory has a public and private key. The private key is used in the signature generation process and the public key is used in the signature verification process. For both signature generation and verification, the data which is referred to as a message, M, is reduced by means of the Secure Hash Algorithm (SHA-1). An adversary, who does not know the private key of the signatory, cannot generate the correct signature of the signatory. However, by using the signatory's public key, anyone can verify a correctly signed message. A means of associating public and private key pairs to the corresponding users is required. That is, there must be a binding of a user's identity and the user's public key. This binding may be certified by a mutually trusted party.

DSA PARAMETERS The DSA makes use of the following parameters: 1. p = a prime modulus, where 2L-1 < p < 2L for 512 L 1024 and L a multiple of 64 2. q = a prime divisor of p - 1, where 2159 < q < 2160 3. g = h(p-1)/q mod p, where h is any integer with 1 < h < p - 1 such that h (p-1)/q mod p>1 (g has order q mod p) 4. x = a randomly or pseudo randomly generated integer with 0 < x < q 5. y = gx mod p 6. k = a randomly or pseudo randomly generated integer with 0 < k < q The integers p, q, and g can be public and can be common to a group of users. A user's private and public keys are x and y, respectively. They are normally fixed for a period of time. Parameters x and k are used for signature generation only, and must be kept secret. Parameter k must be regenerated for each signature. Parameters p, q and x, k shall be generated as specified by FIPS approved security methods. FIPS approved security methods.

DSA Signature Verification Let M, r, and s be the received versions of M, r, and s, respectively, and let y be the public key of the signatory. To verify the signature, the verifier first checks to see that 0 < r < q and 0 < s < q; if either condition is violated the signature shall be rejected. If these two conditions are satisfied, the verifier computes w = (s)-1 mod q u1 = ((SHA-1(M))w) mod q u2 = ((r)w) mod q v = (((g)u1 (y)u2) mod p) mod q If v = r, then the signature is verified and the verifier can have high confidence that the received message was sent by the party holding the secret key x corresponding to y. For a proof that v = r when M = M, r = r, and s = s, If v does not equal r, then the message may have been modified, the message may have been incorrectly signed by the signatory, or the message may have been signed by an impostor. The message should be considered invalid. 1.2 Literature Review Localized Lossless Authentication Watermark (L-LAW) is a secure, flexible, computationally efficient lossless image authentication watermark with tamper localization ability, low embedding distortion and public/private key support. LLAW is an implementation of the LAW framework using the hierarchical image authentication scheme and the lossless generalized-LSB data embedding method. The proposed framework is flexible and compatible with the existing lossless (reversible) data embedding and fragile image authentication algorithms.

CHAPTER 2 SYSTEM ANALYSIS


2.1 Existing System Description The watermark embedding phase has two stages: a) an authentication-information (e.g., digital signature) computation step; and b) a lossless (reversible) data embedding step, in which the computed information is inserted into the image data in a reversible manner. During the recovery and verification phase, first the data embedding process is reversed to yield an estimate for the original image and the authentication information. If the watermarked image has not been altered, the extracted information validates the estimated image and this estimate is labeled as an authentic original implemented the lossless data embedding step by compression and replacement of one or more least-significant bit planes of the image data. Methods based on the circular interpretation of the image histogram, difference expansion, and histogram modifications; respectively .Another method protocol based on the least significant bit (LSB) compression technique .The protocol utilizes a public and a private key signature corresponding to the most and least significant bit planes, respectively. When combined with the encryption of the compressed LSB information, the method allows for public-key verification of the watermarked image while reserving the reconstruction of the perfect original to the authorized parties that hold the private-key. None of the Existing lossless authentication methods in the literature offer tamper localization capability, which is one of the major advantages of authentication watermarks over conventional digital signatures.

2.2 Proposed System Description Localized Lossless Authentication Watermark (L-LAW) is a secure, flexible, computationally efficient lossless image authentication watermark with tamper localization ability, low embedding distortion and public/private key support. L-LAW is an implementation of the LAW framework using the hierarchical image authentication scheme and the lossless generalized-LSB data embedding method. The proposed framework is flexible and compatible with the existing lossless (reversible) data embedding and fragile image authentication algorithms. 2.3 User Interface Requirements Module1 Description Embedding phase: The watermark embedding phase consists of two steps: (a) reversible pre-embedding, and (b) authentication watermarking, which are coordinated through suitable partitioning of the image data (storage) locations. The image is divided into blocks that correspond to the elementary localization units of the hierarchical authentication watermark used in the subsequent authentication watermarking step. In each block, LSBs of the first pixels N (in the raster-scan order) are designated to carry the authentication payload, where N and the block sizes are determined by the security and localization requirements. These selected LSBs constitute the part PA. The more significant bits (MSBs) for the shaded regions and all the bits for other pixels constitute the part P1 that carries the (complete) image information. The MSBs are defined to include all bits other than the LSBs included in part PA. In the pre-embedding step of the watermark embedding phase, the LSB values in part PA are read and reversibly

embedded into the rest of the image using Lossless generalized-LSB (LGLSB) data embedding. In the embedded version of the image, the LSBs carry the compressed bit stream of original LSBs as well as the payload data. The algorithm may be applied selectively on part of the image, a fact that we exploit in our implementation of pre-embedding: we use the image data in part as the payload and embed it in spatial pixel locations corresponding to the white regions The data in part PA, i.e., LSBs in shaded regions of is then reset to 0 to produce the pre-embedded image. Module2 Description The hierarchical image authentication scheme: The hierarchical block-based watermarking technique inserts and extracts a watermark in a multilevel hierarchy. The (Non overlapping) blocks of the pre-embedded image constitute the lowest level of the hierarchy. Successive levels of the hierarchy are formed by combining distinct groups of blocks at a preceding level of the hierarchy. In general, the number of blocks from a lower level of the hierarchy that are combined to form a block at the next level of the hierarchy may be arbitrarily chosen. For each block at each level of the multilevel hierarchy, a digital signature or message authentication code (MAC [2]) is computed for the data (in the pre-embedded image) within the block. These signatures are then placed in the part of the image data locations corresponding to LSBs. In order to incorporate localization capability, the distribution of the signature information bits also follows the quad-tree hierarchy. The LSBs for the shaded region within each block contain the entire signature for the block at the lowest level of the hierarchy in which it is located, 1/4 of the signature bits for the second level of the hierarchy, 1/16 of the signature bits for the third level of the hierarchy, and so on. This packetization of signatures ensures that the signature of each block is contained within the

10

part of image bits for the block. The hierarchical nature of the scheme provides security against vector-quantization attacks and good tamper localization accuracy.

Module3 Description Verification Phase: On the receiver side, the watermark verification and recovery process begins by overlaying the grid of image blocks (at the lowest level of the hierarchy) over the image pixels which allows the determination of the parts and that carry authentication information and image information, respectively the (presumed) authentication information from bits constituting part PA is then extracted and these bits are reset to zero in the image. If the received image is exactly the watermarked image (no alterations), this process recovers the preembedded image that was produced at the embedder. Next, the quad-tree hierarchy is overlaid on the image blocks (and the corresponding extracted authentication information) to compute signatures corresponding to each of blocks in the hierarchy and validate these against the signatures already extracted from part PA. First, the signature for the entire image (corresponding to the highest level of the hierarchy) is computed and verified against the signature computed from the (presumed) pre-embedded image already recovered. If the image/signature pair is valid, the image is deemed authentic and (if required) the recovery component of the lossless G-LSB algorithm is utilized to extract and restore the original LSBs, effectively reconstructing the original image. If the image signature verification step fails, the hierarchical authentication scheme determines the tampered regions. Invalid blocks are indicated on a tamper localization map. For each region, the method indicates the highest level of the authentication hierarchy for which the embedded signature is valid.

11

2.4 Feasibility Study Feasibility study depending on the results of the initial investigation, the survey is expanded to a more detailed feasibility study. Feasibility study emphasizes on the likelihood and the utility of the system to the organization in the background of the costs, benefits, and already existing resources. It is also a test of the system proposal according to its workability impact on the organization ability to meet user needs and effective use of resources. The objectives of a feasibility study are not to solve the problem but to acquire a sense of its scope. During this study the problem definition s crystallization and aspects of the problem to be included in the system are determined cost and benefits are estimated with grater accuracy at this stage. The system is economically feasible because no additional cost is incurred in implementing it. It focuses on three major questions. What are the users demonstrable needs and how does the system meets them. What resources are available for the given system? Is the problem worth solving? What is the likely impact of the system on the organization? How well does it fit within the organization MIS plan. Three essential considerations are involved in the feasibility analysis. Economic Feasibility Study. Technical Feasibility Study. Behavioral Feasibility Study.

12

Economic Feasibility Economic analysis is the most frequently used method for evaluating the effectiveness of the system. More commonly known as cost/benefit analysis, the procedure is to determine the benefits and savings that are accepted from the system and compare them with cost. Technical Feasibility Technical feasibility centers on the existing computer system (hardware, software) and to what extent it can support the proposed addition. It also involves financial considerations to accommodate technical enhancements. If the budget is a serious constraint, then the project is judged not feasible. Behavioural Feasibility People are inherently resistant to change, and computers have been known to facilitate change. An estimate is made of how strong a reaction the user staff is likely to have toward the development of a computerized system.

13

CHAPTER 3 DEVELOPMENT ENVIRONMENT


3.1 Hardware Environment Ram Processor Hard Disk 3.2 Software Environment Operating System Language Back End Documentation Tool Software Description Visual Basic .NET and the .NET Framework Visual Basic .NET is designed around the .NET Framework, which provides enhanced security, memory management, versioning, and deployment support. The .NET Framework also enables interoperability between objects you create with any .NET programming language. This means you can create objects with Visual Basic .NET that are easy to use from other .NET languages, and you can use objects from other .NET languages just like you use objects created with Visual Basic .NET. : : : : Windows 98/2000/XP VB.NET MS-Sql Server Ms word 2000 : : : 256 MB and Above P3 and Above 20 GB and Above

14

.Net .NET is a platform that can be used for building and running the next generation of Microsoft Windows and Web applications. The goal of the Microsoft .NET platform is to simplify web development. The .Net Framework provides the foundation upon which application and XML web services are build and executed the unified Nature of the .Net Framework means that all applications, whether they are windows applications, web applications are XML web services are developer by using a common set tools and code, and are easily integrated with one another. The .NET Framework consists of 1. The Common Language Runtime. The runtime handles runtime services, including language integration, security and memory management. During development, the runtime provides features that are needed to simplify development. 2. Class Libraries. Class libraries provide reusable code for most common task, including data access, XML web service development, web and windows forms.

15

The .NET Framework Components The .NET Framework provides the compile time and runtime foundation to build and run. .Net-based applications. The .NET Framework consists of different components that help to build and run. Net-based applications:

1. Platform substrate 2. Application Service 3. . Net Framework Class Library 4. Common Language Runtime 5. Microsoft ADO.NET 6. ASP .NET 7. XML Web services 8. User Interfaces 9. Languages

16

Benefits of using .NET Framework The benefits of using the .Net Framework for developing application include: Based on Web standards and practices The .Net framework fully supports existing Internet technologies, including HTML, HTTP, XML, SOAP and other Web standards. Design using unified application models

The functionality of a .Net class is available from any .Net compatible languages are programming model. Therefore, the same piece of code can be used by windows applications, web applications and XML web services. Easy for developers to use

The .NET Framework provides the unified type system, which can be used by any .NET-compatible language. In the unified type system, all language elements are objects. These objects can be used by any .Net applications written in any .NET-based language. Extensible classes

The hierarchy of the .Net Framework is not hidden from the developer. You can access and extend .Net classes through inheritance.

VB .NET Visual Basic .NET is one of the languages that are directed towards meeting the objectives of the .NET initiative of creating distributed applications. Visual Basic .NET is the successor to Visual Basic 6. It is a software language used to build applications targeted for the Microsoft .NET platform. Visual Basic .NET is a powerful object-oriented language that provides features such as abstraction, encapsulation, inheritance and polymorp

17

Features of Visual Basic .NET Some of the key features introduced in Visual Basic .NET are as follows: 1) Overriding 2) Overloading 3) Inheritance 4) Structured Exception handling 5) Multithreading 6) Constructors and Destructors

18

CHAPTER 4 SYSTEM DESIGN


4.1 Data Model 4.1.1 Physical data design

Fig 4.1 Localized Lossless Authentication Watermark: (a) Embedding (b) Detection & Recovery.

19

Protected Image

Watermarked Image

Edge Detection

Signature Embedding

Creating watermark

Comparing Signature

Permuting Block

Watermark Embedding

Fig 4.2 Embedding process of digital signature and watermarking

20

Authentication Data Host Image Embed Watermark Key Watermarked Image

Authentication Data

Validate Integrity

Extract Watermark Key

Watermarked image

Fig 4.3 Authentication Watermark

21

4.2 Process Model 4.2.1 Data Flow Diagram (DFD) Read & Reset Selected LSBs

Verifying

Embedding Phase

Read & Reset Selected LSBs

G-LSB Data Embeddin g

Reversible Pre-Embedding

Calculat e Signatur e

Modify Selected LSBs

Authentication Watermarking

22

Watermark Verification and Recovery

Read & Reset Selected LSBs

Verify Signature

Watermark Verification

Data Extraction & Image Recovery

Modify Selected LSBs

Watermark Image

23

Process Description: Process 1 Watermark Embedding Input: Any Image file. Method: Read & Reset Selected LSBs, Lossless G-LSB data embedding, Calculating Signatures, Modify selected LSBs. Output: Watermarked Image.

Process 2 Watermark Verification and Recovery Input: Watermarked Image. Method: Verify signatures, Data Extraction & Recovery, Read & Reset Selected LSBs, Modify Selected LSBs. Output: Original Image.

24

CHAPTER 5 ARCHITECTURE DETAILS


5.1 Program Design Language In order to employ the algorithm first conversion of binary input h into a string of L-ary symbols is necessary to prevent overflows. The algorithm is motivated by arithmetic coding for equi-probable input symbols. By interpreting the binary input string as the binary representation of a number H in the interval [0,1], i.e. H=.h 0 h 1 h 2 . . . and H [0,1].Let R initially represent this interval [0,1]. For description, assume the signal is encoded with integer values between zero and s max. The pre-conversion includes the following steps. 1. Given s and s max, determine Q L (s) and the number of possible levels N=min (L, s max Q L (s)). 2. Divide R into N equal sub-intervals, R 0 to R N1. 3. Select the sub-interval that satisfies H R n. 4. Next watermark symbol is w=n. 5. Set R=R n and go to step 1, for the next sample. In particular, watermark symbols, w, are converted into a binary number H by successively partitioning the interval R= [0,1]. The number of partitions (active levels), N, on a given signal sample s w are obtained from Q L (s w) =Q L (s).

25

Pseudo-code for this process is given as: 1. Given s w and s max, determine Q L (s w ) and the number of possible levels N=min(L, s max Q L (s w )). 2. Divide R into N equal sub-intervals, R 0 to R N1. 3. Set R=R w, where w=s w Q L (s w) is the current watermark symbol. 4. If there are remaining symbols go to step 1. 5. Find the shortest binary string H R. Embedding capacity and distortion will now be considered. In Generalized-LSB embedding (Eqn. 1), each signal sample carries an L-ary watermark symbol w i which represents log 2 (L) bits of information. Therefore, the embedding capacity of the system is C GLSB =log 2 (L) (4) bits per sample (bps) (barring boundary effects due to overflow restrictions).

CHAPTER 6

26

SYSTEM IMPLEMENTATION
Attributes There are many attributes that have to be considered to determine the performance of the project. They include reliability, portability, efficiency, usability, maintainability, re-usability. Reliability Reliability is the allowable time between failures, or the total allowable failure rate. The communication between the modules are intimated to the user. Portability Portability enables to run on every supported workstation. The developed software should portable to the work environment. Efficiency Efficiency can only be achieved by not consuming excessive amount of resources. Usage of memory properly, storing only necessary information. Usability Project should be usable by a novice user. A detail description of the project should be explained to the novice.

27

Maintainability Code should be written in a way to minimize the effort required to fix errors, be understandable to any technical competent individual, and provide a clear documentation. Re-usability Re-usability is envisioned to be a set of inter-operating programs and not a large and not a monolithic entity. Able to reuse the classes due to modularity. Any activity type can make use of same transaction facilities.

6.1 Sample Coding

28

----------------------------------------------------------------------------------------Lossless Watermarking for Image Authentication -----------------------------------------------------------------------------------------//Alice Imports System.Security.Cryptography Imports System.Text Public Class Alice '========================================= ' Alice is Receiver who will decrypt data from sender '======================================== Private rsaPubParams As RSAParameters ' stores public key Private rsaPrivateParams As RSAParameters 'stores private key Public Sub New() 'create new instance of RSACryptoServiceProvider Dim rsaCSP As New RSACryptoServiceProvider 'Generate public and private key data and allowing their exporting. rsaPrivateParams = rsaCSP.ExportParameters(True) rsaPubParams = rsaCSP.ExportParameters(False) End Sub 'New Public ReadOnly Property PublicParameters() As RSAParameters Get Return rsaPubParams End Get End Property Public ReadOnly Property PrivateParameters() As RSAParameters Get Return rsaPrivateParams End Get End Property Public Function VerifyHash(ByVal rsaParams As RSAParameters, ByVal signedData() As Byte, ByVal signature1() As Byte) As Boolean 'create new instance of RSACryptoServiceProvider Dim rsaCSP As New RSACryptoServiceProvider 'create new instance of SHA1 hash algorithm to compute hash Dim hash As New SHA1Managed 'a byte array to store hash value Dim hashedData() As Byte 'import public key params into instance of RSACryptoServiceProvider rsaCSP.ImportParameters(rsaParams)

29

'compute hash with algorithm specified as here we have SHA1 hashedData = hash.ComputeHash(signedData) ' Sign Data using public key and OID is simple name of the algorithm for which to get the object identifier (OID) Return rsaCSP.VerifyHash(hashedData, CryptoConfig.MapNameToOID("SHA1"), signature1) End Function 'VerifyHash 'Decrypt using the private key data. Public Function DecryptData(ByVal encrypted1() As Byte) As String 'a byte array to store decrypted bytes Dim fromEncrypt() As Byte ' holds orignal message Dim roundTrip As String Dim rsaCSP As New RSACryptoServiceProvider 'import private key params into instance of RSACryptoServiceProvider rsaCSP.ImportParameters(rsaPrivateParams) 'store decrypted data into byte array fromEncrypt = rsaCSP.Decrypt(encrypted1, False) 'convert bytes to string roundTrip = enc.GetString(fromEncrypt) Return roundTrip End Function 'DecryptData End Class //Bob Imports System.Security.Cryptography Imports System.Text Public Class Bob Private rsaPubParams As RSAParameters Private rsaPrivateParams As RSAParameters Public Sub New() Dim rsaCSP As New RSACryptoServiceProvider rsaPrivateParams = rsaCSP.ExportParameters(True) rsaPubParams = rsaCSP.ExportParameters(False) End Sub Public ReadOnly Property PublicParameters() As RSAParameters Get Return rsaPubParams End Get End Property

30

Public Function HashAndSign(ByVal encrypted() As Byte) As Byte() Dim rsaCSP As New RSACryptoServiceProvider Dim hash As New SHA1Managed 'Dim px, py As Integer Dim r, g, b As Integer Dim hashedData() As Byte rsaCSP.ImportParameters(rsaPrivateParams) hashedData = hash.ComputeHash(encrypted) 'hashedData = hash.ComputeHash(px, py, Color.FromArgb(0, r, g, b)) Return rsaCSP.SignHash(hashedData, CryptoConfig.MapNameToOID("SHA1")) End Function Public Function EncryptData(ByVal rsaParams As RSAParameters, ByVal toEncrypt() As Byte) As Byte() Dim rsaCSP As New RSACryptoServiceProvider rsaCSP.ImportParameters(rsaParams) Return rsaCSP.Encrypt(toEncrypt, False) End Function End Class //hierichicalsheme Public Class HierarchicalSheme Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) MessageBox.Show("Hierarchical Scheme is applied...") End Sub Private Sub HierarchicalSheme_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked Me.Hide() Dim way As dsa = New dsa() way.Show() End Sub

31

Private Sub LinkLabel2_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel2.LinkClicked Dim way1 As Verify = New Verify() way1.Show() End Sub End Class //Verifiy Imports System.Security.Cryptography Imports System.IO Public Class Verify Inherits System.Windows.Forms.Form Dim wwstr1 As String Dim wwstr As String Dim ss As String Dim row As Integer Friend WithEvents Label2 As System.Windows.Forms.Label Dim col As Integer #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer

32

Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents TextBox4 As System.Windows.Forms.TextBox Friend WithEvents Label4 As System.Windows.Forms.Label Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox Friend WithEvents btn_browse As System.Windows.Forms.Button Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog Friend WithEvents TextBox1 As System.Windows.Forms.TextBox Friend WithEvents Label1 As System.Windows.Forms.Label Private Sub InitializeComponent() Me.Button1 = New System.Windows.Forms.Button Me.TextBox4 = New System.Windows.Forms.TextBox Me.Label4 = New System.Windows.Forms.Label Me.PictureBox2 = New System.Windows.Forms.PictureBox Me.btn_browse = New System.Windows.Forms.Button Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog Me.TextBox1 = New System.Windows.Forms.TextBox Me.Label1 = New System.Windows.Forms.Label Me.Label2 = New System.Windows.Forms.Label CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'Button1 ' Me.Button1.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button1.Location = New System.Drawing.Point(429, 281) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(117, 25) Me.Button1.TabIndex = 0 Me.Button1.Text = "Verify Image" ' 'TextBox4 ' Me.TextBox4.Location = New System.Drawing.Point(12, 286) Me.TextBox4.Name = "TextBox4"

33

Me.TextBox4.Size = New System.Drawing.Size(264, 20) Me.TextBox4.TabIndex = 26 ' 'Label4 ' Me.Label4.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label4.ForeColor = System.Drawing.Color.Black Me.Label4.Location = New System.Drawing.Point(65, 80) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(144, 20) Me.Label4.TabIndex = 25 Me.Label4.Text = "Watermarked Image" ' 'PictureBox2 ' Me.PictureBox2.Location = New System.Drawing.Point(12, 128) Me.PictureBox2.Name = "PictureBox2" Me.PictureBox2.Size = New System.Drawing.Size(256, 122) Me.PictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.PictureBox2.TabIndex = 24 Me.PictureBox2.TabStop = False 'btn_browse Me.btn_browse.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btn_browse.ForeColor = System.Drawing.Color.Maroon Me.btn_browse.Location = New System.Drawing.Point(333, 282) Me.btn_browse.Name = "btn_browse" Me.btn_browse.Size = New System.Drawing.Size(77, 25) Me.btn_browse.TabIndex = 27 Me.btn_browse.Text = "Browse"

Me.Controls.Add(Me.Button1)

34

Me.Name = "Verify" Me.Text = "Verify" CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub //Dsa Imports System.Text Imports System.Drawing 'Imports System.Drawing.Image Imports System.Drawing.Imaging Imports System.Data Imports System.Security.Cryptography Imports System.Data.OleDb Imports System.IO Public Class dsa Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor.

35

Me.Button3 = New System.Windows.Forms.Button Me.LinkLabel1 = New System.Windows.Forms.LinkLabel CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() 'TextBox2 Me.TextBox2.BackColor = System.Drawing.Color.White Me.TextBox2.ForeColor = System.Drawing.Color.Black Me.TextBox2.Location = New System.Drawing.Point(224, 155) Me.TextBox2.Multiline = True Me.TextBox2.Name = "TextBox2" Me.TextBox2.ReadOnly = True Me.TextBox2.ScrollBars = System.Windows.Forms.ScrollBars.Vertical Me.TextBox2.Size = New System.Drawing.Size(288, 40) Me.TextBox2.TabIndex = 12 'TextBox1 Me.TextBox1.BackColor = System.Drawing.Color.White Me.TextBox1.ForeColor = System.Drawing.Color.Black Me.TextBox1.Location = New System.Drawing.Point(224, 96) Me.TextBox1.Multiline = True Me.TextBox1.Name = "TextBox1" Me.TextBox1.ReadOnly = True Me.TextBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical Me.TextBox1.Size = New System.Drawing.Size(288, 40) Me.TextBox1.TabIndex = 1 'btn_sign Me.btn_sign.BackColor = System.Drawing.Color.White Me.btn_sign.ForeColor = System.Drawing.Color.Maroon Me.btn_sign.Location = New System.Drawing.Point(16, 155) Me.btn_sign.Name = "btn_sign" Me.btn_sign.Size = New System.Drawing.Size(184, 40) Me.btn_sign.TabIndex = 10 Me.btn_sign.Text = "Generate &Signature Block using Sender's Private Key" Me.btn_sign.UseVisualStyleBackColor = False 'btn_R_Publickey Me.btn_R_Publickey.BackColor = System.Drawing.Color.White Me.btn_R_Publickey.ForeColor = System.Drawing.Color.Maroon Me.btn_R_Publickey.Location = New System.Drawing.Point(16, 96)

36

Me.PictureBox2.SizeMode= System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.TextBox4.TabIndex = 22 'btn_browse Me.btn_browse.ForeColor = System.Drawing.Color.Maroon Me.btn_browse.Location = New System.Drawing.Point(104, 409) Me.btn_browse.Name = "btn_browse" Me.btn_browse.Size = New System.Drawing.Size(56, 22) Me.btn_browse.TabIndex = 23 Me.btn_browse.Text = "Browse" 'TextBox3 Me.TextBox3.Location = New System.Drawing.Point(424, 374) Me.TextBox3.Name = "TextBox3" Me.TextBox3.Size = New System.Drawing.Size(256, 21) Me.TextBox3.TabIndex = 24 'btn_save Me.btn_save.ForeColor = System.Drawing.Color.Maroon Me.btn_save.Location = New System.Drawing.Point(464, 408) Me.btn_save.Name = "btn_save" Me.btn_save.Size = New System.Drawing.Size(160, 23) Me.btn_save.TabIndex = 25 Me.btn_save.Text = "Save Watermarked Image" 'Button1 Me.Button1.BackColor = System.Drawing.Color.White Me.Button1.ForeColor = System.Drawing.Color.Maroon Me.Button1.Location = New System.Drawing.Point(16, 48) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(184, 40) Me.Button1.TabIndex = 26 Me.Button1.Text = "&Read and Reset the LSBs" Me.Button1.UseVisualStyleBackColor = False 'Button2 Me.Button2.DialogResult = System.Windows.Forms.DialogResult.Cancel Me.Button2.ForeColor = System.Drawing.Color.Maroon Me.Button2.Location = New System.Drawing.Point(301, 279) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(96, 56) Me.Button2.TabIndex = 27 Me.Button2.Text = "Embedd Original LSBs " 'Button3 Me.Button3.ForeColor = System.Drawing.Color.Maroon Me.Button3.Location = New System.Drawing.Point(301, 337) Me.Button3.Name = "Button

37

Me.ShowInTaskbar = False Me.StartPosition= System.Windows.Forms. FormStartPosition.Cente rScreen Me.Text = "L-LAW" CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() End Sub //Login Form Imports System.Data Imports System.Data.SqlClient Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub

38

Friend WithEvents TextBox2 As System.Windows.Forms.TextBox Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents Label3 As System.Windows.Forms.Label 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Private Sub InitializeComponent() Me.Label1 = New System.Windows.Forms.Label Me.Label2 = New System.Windows.Forms.Label Me.TextBox1 = New System.Windows.Forms.TextBox Me.TextBox2 = New System.Windows.Forms.TextBox Me.Button1 = New System.Windows.Forms.Button Me.Label3 = New System.Windows.Forms.Label Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(188, 115) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(100, 19) Me.Label1.TabIndex = 0 Me.Label1.Text = "USERNAME" ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label2.Location = New System.Drawing.Point(190, 172) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(98, 19) Me.Label2.TabIndex = 1 Me.Label2.Text = "PASSWORD" '

39

'TextBox1 ' Me.TextBox1.Location = New System.Drawing.Point(354, 115) Me.TextBox1.Name = "TextBox1" Me.TextBox1.Size = New System.Drawing.Size(100, 20) Me.TextBox1.TabIndex = 2 ' 'TextBox2 ' Me.TextBox2.Location = New System.Drawing.Point(354, 173) Me.TextBox2.Name = "TextBox2" Me.TextBox2.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42) Me.TextBox2.Size = New System.Drawing.Size(100, 20) Me.TextBox2.TabIndex = 3 ' 'Button1 ' Me.Button1.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button1.Location = New System.Drawing.Point(291, 242) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(75, 23) Me.Button1.TabIndex = 4 Me.Button1.Text = "LOGIN" Me.Button1.UseVisualStyleBackColor = True ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label3.Location = New System.Drawing.Point(62, 38) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(544, 19) Me.Label3.TabIndex = 5 Me.Label3.Text = "REVERSIBLE PRE-EMPEDDING AUTHENTICATION WATER MARKING" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

40

Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer), CType(CType(255, Byte), Integer)) Me.ClientSize = New System.Drawing.Size(773, 354) Me.Controls.Add(Me.Label3) Me.Controls.Add(Me.Button1) Me.Name = "Form1" Me.ResumeLayout(False) Me.PerformLayout() End Sub #End Region Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim con As New SqlConnection("Data Source=.;Initial Catalog=master;User ID=sa") con.open() Dim com As New SqlCommand("Select * from water", con) Dim dr As SqlDataReader dr = com.ExecuteReader While (dr.Read) If (TextBox1.Text= dr.GetString(0) And TextBox2.Text = dr.GetString(1)) Then Dim frm As New HierarchicalSheme frm.Show() Else MsgBox("Invalid User") End If End While End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class

41

CHAPTER 7 TESTING
7.1 Testing Methodologies Purpose of Testing Testing is performed to verify that the completed software package functions according to the expectations defined by the requirements or specifications. The overall objective is not to find every software bug that exists, but to uncover situations that could negatively impact the customer, usability, and/or maintainability. Testing Strategies Unit Testing Unit testing is a test that validates that individual units of source code are working properly. A unit is the smallest testable part of an application. In procedural programming a unit may be an individual program, function, procedure, etc., while in object-oriented programming, the smallest unit is a method, which may belong to a base/super class, abstract class or derived/child class. Integration Testing Integration testing is an additional step that is used when different sub-systems are being developed simultaneously by independent developers. It verifies that the parameters passed between sub-systems are being handled correctly. RegressionTesting Regression testing is retesting sub-systems/modules/units to insure that modifications to one sub-system, module, unit does not cause unexpected results in another sub-system/module/unit. This is also known as ripple effect testing.

42

Performance Testing Performance testing is performed, from one perspective, to determine how fast some aspect of a system performs under a particular workload. It can also serve to validate and verify other quality attributes of the system, such as scalability, reliability and resource usage. Recovery Testing It is a system test that forces the software to fail in a variety of ways and verifies that recovery is properly performed. It involves the correctness of, Re-initialization, Data Recovery Restart. Thus by conducting above tests, the tester can uncover situations that lead to degradation and possible system failure. In this project it is successful. The execution time is minimum for all parts of the unit and the device utilization by the program unit is acceptable.

43

CHAPTER 8 PERFORMANCE AND LIMITATIONS

8.1 Merits of the system Advantage of the proposed framework is the reduction in the average computational requirements. By validating the authenticity of the image first, we avoid the computationally expensive image reconstruction step when i) The watermarked image is of sufficient quality and the original image reconstruction is not necessary. ii) The image under inspection is not authentic, i.e. it has been tampered after watermarking or iii) The image has not been watermarked at all. If the original image is reconstructed, its authenticity is inferred from that of the pre-embedded image without any additional computation or sacrifice of security. Lossless G-LSB algorithm is mostly applied over medical and military images. 8.2 Limitations of the system The signature may be lost or it may be hacked by an unauthorized user. Performance of the lossless data embedding technique -overall algorithm depends on the image content. The main demerit of image authentication is extra storage needed, hard authentication method is applied over the images to detect any modification and also lossless format conversion loses authenticity.

44

CHAPTER 9 APPENDICES
Sample Screens Login Form

This window validates whether authorized users enters the system, the username and password are verified and validated by the data available on the back end.

45

Window for Embedding, Encryption and Signature Generation

It shows that the window performs three main functions they are a) Reversible Pre-Embedding, b) Encryption by Lossless G-LSB algorithm and c) Generating signatures using senders private key. The source image file is found and the above three functions are processed over the image.

46

Window for Signature Embedding

It shows that the digital signature and the secret value had been embedded in the image without any distortion or loss. After embedding the watermarked image is stored in a separate file with intended name.

47

Window for verification phase 1

It shows that the source image is retrieved for verification and the process done and the result displayed in message box as valid or invalid.

48

Window for verification phase 2

The window shows that an invalid signature has been embedded in the image and therefore a message box displays Signature Invalid. The signature for each image has been set by the embedder for security purpose.

49

Database Table

50

9.2 Reports Image PSNR (dB) File size (Bytes)

F-16 Mandrill Boat Barbara Gold Hill Lena

56.54 46.51 52.91 52.91 50.83 52.83

2876 1440 2658 2019 1819 1510

Average

52.09

2054

As seen in table the average, the file size increases by 2054 Bytes, which is significantly larger than the 584 Byte authentication code inserted during watermarking. The increase in file size can be attributed to the properties of the lossless data embedding scheme. The Lossless Watermarking for image Authentication had been applied to the above images and the results are observed. The effect of Localized LAW on the compression efficiency of JPEG codec has been measured by comparing the compressed file size before and after watermarking.

51

CHAPTER 10 REFERENCES
M. U. Celik, G. Sharma, E. Saber, and A. M. Tekalp Hierarchical watermarking for secure image authentication with localization, IEEE Trans. on Image Proc. 11, June 2002. C. Honsinger, P. Jones, M. Rabbani, and J. Stofel, Lossless recovery of an original image containing embedded data, US Pat. #6,278,791 , Aug 2001. A.Menezes, P. van Oorchot, and S. Vanstone, Handbook of Applied Cryptography, CRC Press, Florida, USA, 1997. D. Stinson, Cryptography: Theory and Practice, CRC Press, Florida, USA, 1995. P. Wong,A public key watermark for image verification and authentication, Proc. of IEEE ICIP,pp. 425 429, (Chicago, USA), October 4-7, 1998.

52

Potrebbero piacerti anche