Skip to content

This project is about encrypting an grayscale image using Chaos methodology

Notifications You must be signed in to change notification settings

Mr-Grimmer/Partial-Image-Encryption-Using-Chaos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Partial-Image-Encryption-Using-Chaos

This project is about encrypting an grayscale image using Chaos methodology

Chaos-Based Symmetric Key Partial Image Encryption

This repository contains an implementation of a chaos-based symmetric key partial encryption technique for 8-bit/pixel grayscale images. The method involves decomposing the original image into its 8 binary bit planes, determining significant bit planes, encrypting them using a key stream generated by a 'Cross-Coupled Chaotic Random Bit Generator,' and then combining them with the unencrypted ones to create a cipher image.

Table of Contents

Description

In a gray-level image, each pixel's intensity is quantized into an 8-bit binary value, ranging from 0 to 255. The value of a pixel at coordinate (x, y) is represented as an 8-bit binary number. The input image is divided into 8 binary images according to the bit locations within a pixel.

Step 1: Bit Plane Decomposition

Each pixel can be decomposed into an 8-bit binary value as follows: f(x, y) = P(8) P(7) P(6) P(5) P(4) P(3) P(2) P(1)

So, the input image is divided into 8 binary images according to the bit locations within a pixel.

Step 2: Significant Bit-Plane Determination

The significance of a bit in an 8-bit binary number is determined by its position. Bits in the 8th position (Most Significant Bit - MSB) contribute significantly to the decimal value, while bits in the 1st position (Least Significant Bit - LSB) contribute minimally.

Getting Started with the actual encryption

Method of Encryption

  1. Step 1: The plain image is considered as loriginal (x, y) of size M ✕ N.
  2. Step 2: Each pixel value P(x, y) in loriginal (x, y) is decomposed into its corresponding 8-bit binary equivalent, resulting in 8 planes BP(x, y) for each pixel.
  3. Step 3: Significant bit planes are determined by the level α critical region, testing the percentage contribution of a bit plane in the formation of a pixel.
  4. Step 4: Keys for diffusing the significant bit planes are generated using an ID logistic map based on a PRBG with chosen values of the triplet (x0, y0, μ).
  5. Step 5: The significant bit planes, determined by a critical region level α (e.g., 0.05), are ciphered as CBPj = BPj ⊕ Kj.
  6. Step 6: The cipher bit planes CBPj and the encrypted bit plane BPj are combined to form the cipher image as Ci(x, y) = CBPj + BPk for i = 1, 2,...,8, j = 1,...,4, and k = 5,...8, with "+" being used for the combining process.

Result and Analysis

Subjective Quality Assessment

Human's visual quality assessment is "subjective." The human beings' ability to assess the visual quality of an image is influenced by many aspects such as the level of interaction with the scene, the comfortability of the viewing environment, and the viewer's state of mind. Subjective assessment considers test conditions such as viewing distance, test duration, and observer recruitment.

As the proposed algorithm is lossless (which means no loss in the image information), the subjective quality assessment may reveal an identical subjective match between the original and the decrypted images. Therefore, subjective assessment is inadequate.

Objective Quality Assessment

Objective quality assessment provides a more reliable evaluation of the proposed algorithm. It includes the following statistical tests:

Visual Test through Histogram Analysis

An image histogram demonstrates how pixels in an image are distributed by graphing the number of pixels at each intensity level. To achieve a perfectly ciphered image, the histogram must exhibit uniform distribution of pixels against intensity values. The histograms of the original and corresponding Cipher Images are analyzed.

Measures of Central Tendency and Dispersion

Measures of Central Tendency and Dispersion are used as a measure of homogeneity. A comparative analysis shows differences between original and encrypted images. Cipher images exhibit uniform mean and median pixel intensities, indicating homogeneity.

Correlation Coefficient Analysis

In most plain images, there exists high correlation among adjacent pixels. However, poor correlation is observed between the neighboring pixels of corresponding cipher images. Karl Pearson’s Product Moment correlation coefficient is used to measure the correlation of horizontally, vertically, and diagonally adjacent pixels in both plain and cipher images, as well as the correlation between the plain image and cipher image pixels.

Scatter Plot Analysis

A scatter plot (aka scatter chart, scatter graph) uses dots to represent values for two different numeric variables. Scatter plots are used to observe relationships between variables. Identification of correlational relationships is common with scatter plots. In these cases, we want to know if given a particular horizontal value, what a good prediction would be for the vertical value.

Key-Sensitivity Test

A good crypto system should be sensitive to a small change in secret keys. A small change in secret keys in the encryption process should result in a completely different encrypted image. If any of the secret keys changes by a small amount, it should be impossible to retrieve the original image.

Key Space Analysis

A good encryption scheme should be sensitive to secret keys, and the key space should be large enough to make brute force attacks infeasible. In the proposed algorithm, the initial conditions and the system parameters xo, Yo, and the number of iterations for scrambling have been used as keys. With a calculation precision of 10^-14, the secret key space is substantial, making brute force attacks unfeasible.

About

This project is about encrypting an grayscale image using Chaos methodology

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published