Skip to content

A cryptographic implementation that uses chaotic systems (Arnold Map and Henon Map)for secure data encryption.

Notifications You must be signed in to change notification settings

srummanf/Chaos-Map-Data-Encryption

Repository files navigation

Chaos Map Data Encryption using Arnold and Henon Maps

A cryptographic implementation that leverages chaotic dynamical systems for secure image encryption. This project utilizes the mathematical properties of Arnold's cat map and Henon map to generate pseudo-random sequences for encryption keys, providing enhanced security through deterministic chaos theory.

🔍 Overview

This project implements two chaos-based encryption algorithms:

  • Arnold Cat Map: A discrete chaotic map that performs geometric transformations on images
  • Henon Map: A dynamical system that generates pseudo-random bit sequences for XOR encryption

The combination of these methods provides a robust encryption system that scrambles image pixels spatially (Arnold) and modifies pixel values cryptographically (Henon).

🚀 Features

  • Dual encryption approach: Combines spatial scrambling with value transformation
  • Support for both grayscale and color images
  • Reversible encryption/decryption process
  • Chaos theory-based security
  • Automatic key generation from chaotic sequences

📋 Requirements

PIL (Pillow)
numpy
opencv-python (cv2)
matplotlib
tqdm

Install dependencies:

pip install pillow numpy opencv-python matplotlib tqdm

🔧 Installation

  1. Clone this repository:
git clone https://github.com/yourusername/chaos-map-encryption.git
cd chaos-map-encryption
  1. Install required packages:
pip install -r requirements.txt
  1. Download sample images (included in code):
    • HorizonZero.png
    • lena.bmp

📚 Core Functions

Image Processing

  • getImageMatrix(imageName): Converts image to matrix format and extracts metadata

Arnold Cat Map Encryption

  • ArnoldCatTransform(img, num): Applies single Arnold transformation
  • ArnoldCatEncryption(imageName, key): Encrypts image using Arnold cat map
  • ArnoldCatDecryption(imageName, key): Decrypts Arnold-encrypted image

Henon Map Encryption

  • genHenonMap(dimension, key): Generates transformation matrix using Henon map
  • HenonEncryption(imageName, key): Encrypts image using Henon map with XOR operation
  • HenonDecryption(imageNameEnc, key): Decrypts Henon-encrypted image

Utility Functions

  • dec(bitSequence): Converts binary sequence to decimal

🔐 How It Works

Arnold Cat Map

The Arnold cat map applies the transformation:

x' = (x + y) mod n
y' = (x + 2y) mod n

This creates a chaotic scrambling effect that disperses pixel correlations.

Henon Map

The Henon map generates chaotic sequences using:

x(n+1) = y(n) + 1 - 1.4 * x(n)²
y(n+1) = 0.3 * x(n)

The generated values are converted to binary sequences for XOR encryption.

💻 Usage Example

# Arnold Cat Map Encryption
encrypted_img = ArnoldCatEncryption("input_image.png", key=5)

# Arnold Cat Map Decryption  
decrypted_img = ArnoldCatDecryption("input_image_ArnoldcatEnc.png", key=5)

# Henon Map Encryption
HenonEncryption("input_image.png", key=[0.1, 0.2])

# Henon Map Decryption
HenonDecryption("input_image_HenonEnc.png", key=[0.1, 0.2])

🔑 Key Management

Arnold Cat Map

  • Key Type: Integer
  • Range: Positive integers (typically 1-20 for optimal results)
  • Security: Higher values increase scrambling iterations

Henon Map

  • Key Type: List of two float values [x₀, y₀]
  • Range: Typically [-1.5, 1.5] for both values
  • Security: Initial conditions determine the entire chaotic sequence

🔬 Algorithm Details

Arnold Cat Map Properties

  • Period: Depends on image dimensions
  • Reversibility: Guaranteed after a specific number of iterations
  • Security: Based on geometric pixel shuffling

Henon Map Properties

  • Chaos Parameters: a = 1.4, b = 0.3 (classical values)
  • Lyapunov Exponent: Positive, indicating chaotic behavior
  • Sensitivity: Small changes in initial conditions lead to vastly different sequences

🛡️ Security Considerations

  • Key Space: Large key space due to floating-point precision in Henon map
  • Avalanche Effect: Small key changes result in completely different encrypted images
  • Statistical Security: Encrypted images should pass randomness tests
  • Brute Force Resistance: Computationally infeasible due to chaotic key generation

⚠️ Limitations

  • Image Size: Arnold map works best with square images
  • Computational Complexity: O(n²) for both algorithms
  • Key Sensitivity: Exact key values required for successful decryption
  • Floating Point Precision: May affect decryption accuracy across different systems

🧪 Testing

The implementation includes sample images for testing:

  • HorizonZero.png: Color image testing
  • lena.bmp: Grayscale image testing

🏷️ Tags

chaos-theory encryption cryptography arnold-map henon-map data-security dynamical-systems chaos-based-cryptography nonlinear-dynamics python image-processing security mathematics chaotic-maps


Note: This implementation is for educational and research purposes. For production use, additional security measures and thorough cryptanalysis should be conducted.

About

A cryptographic implementation that uses chaotic systems (Arnold Map and Henon Map)for secure data encryption.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published