MCPcopy Index your code
hub / github.com/Bhuvaneshwer2005/tteh-biometric-security

github.com/Bhuvaneshwer2005/tteh-biometric-security @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
50 symbols 164 edges 7 files 45 documented · 90%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🔐 Bl-IEA: A Bit-Level Image Encryption Algorithm using Transformation and Chaotic Skew Tent Map based Substitution for Fingerprint Images

Bl-IEA: A Bit-Level Image Encryption Algorithm using Transformation and Chaotic Skew Tent Map based Substitution for Fingerprint Images

TTEH LAB · School of Engineering, Dayananda Sagar University
Bangalore – 562112, Karnataka, India


Python NumPy PyTorch OpenCV License


Prototype implementation of:

"Bl-IEA: A Bit-Level Image Encryption Algorithm using Transformation and Chaotic Skew Tent Map based Substitution for Fingerprint Images"

IEEE Paper · Research Implementation · Biometric Security


🔭 Overview

Biometric authentication systems, particularly fingerprint recognition, have become ubiquitous in security applications ranging from smartphones to banking. However, storing biometric templates poses significant privacy and security risks since compromised biometric data cannot be changed like passwords. This work presents TTEH-Net, a novel fingerprint image encryption system that combines mathematical transforms with chaotic maps to achieve robust security for biometric data.

TTEH-Net operates on the principle of "transform mathematically, encrypt chaotically" through a two-stage encryption process:

  • Modified Pseudo Hadamard Transform (MPHT) — Mathematical pixel permutation using reversible linear transformations
  • Chaotic Skew Tent Map — Keystream generation through chaotic dynamics with sensitive dependence on initial conditions
  • 8-Round Encryption Pipeline — Iterative application of transformation, substitution, XOR, and saturation
  • Perfect Reversibility — Guaranteed decryption accuracy through mathematical inverse operations

The framework employs a deterministic encryption approach where the same key (x₀, μ parameters) always produces identical ciphertext, enabling verification while maintaining cryptographic strength through chaotic keystream generation.

Key Features:
Mathematical Precision · Chaotic Dynamics · Perfect Reversibility · Real-Time Performance · Biometric Security


📋 Table of Contents

  1. Problem Statement
  2. Proposed Architecture
  3. How It Works
  4. Security Metrics & Results
  5. Code Architecture
  6. Core Modules — Deep Dive
  7. Setup & Usage
  8. Performance Analysis
  9. Security Analysis
  10. Implementation Limitations

1. 🔍 Problem Statement

"How can we protect fingerprint biometric data with encryption that's both mathematically sound and cryptographically strong?"

Fingerprint biometric systems store template data that, if compromised, can lead to permanent identity theft since fingerprints cannot be changed like passwords. Existing encryption approaches suffer from critical limitations:

Standard Encryption Limitations

  • AES-256 — Optimized for general data, doesn't account for biometric pattern structure
  • Chaos-only methods — Lack mathematical rigor, may have weak diffusion properties
  • Image-specific encryption — Often computationally expensive for real-time applications

Biometric Security Challenges

  • Pattern Preservation — Encryption must preserve ability to match after decryption
  • Template Protection — Cancellable biometrics require revocable templates
  • Performance Requirements — Real-time encryption needed for authentication systems
  • Key Management — Secure key distribution for biometric authentication

Threat Landscape

A compromised fingerprint database leads to: - ✅ Permanent identity theft (fingerprints cannot be changed) - ✅ Cross-system attacks (same fingerprint used across multiple systems) - ❌ No revocation mechanism (unlike passwords) - ❌ Privacy violations (sensitive biometric data exposure)

What's Needed → A specialized encryption system that: 1. Uses mathematical transforms for proven security properties 2. Employs chaotic maps for keystream generation 3. Ensures perfect reversibility for authentication 4. Operates efficiently for real-time applications 5. Provides strong resistance to cryptographic attacks


2. 🏗️ Proposed Architecture

TTEH-Net implements a multi-round encryption pipeline with MPHT transformation and chaotic substitution in each round.

System Overview

┌─────────────────────────────────────────────────────────────────────┐
│                        TTEH-Net Architecture                         │
│                                                                      │
│  ┌──────────────┐                                                    │
│  │  Original    │                                                    │
│  │ Fingerprint  │                                                    │
│  │   Image      │                                                    │
│  │  [256×256]   │                                                    │
│  └──────┬───────┘                                                    │
│         │                                                            │
│         ▼                                                            │
│  ┌──────────────────────────────────────────────────────────┐        │
│  │              Encryption Round 1                          │        │
│  │  Step 1: MPHT Transform → f_trans                       │        │
│  │  Step 2: MPHT Transform → s_trans (substitution)         │        │
│  │  Step 3: XOR → r = f_trans ⊕ s_trans                    │        │
│  │  Step 4: Chaotic Substitution → r ⊕ keystream            │        │
│  └──────────────────────┬───────────────────────────────────┘        │
│                         │                                            │
│                         ▼                                            │
│  ┌──────────────────────────────────────────────────────────┐        │
│  │              Encryption Round 2                          │        │
│  │  (Same 4-step process with updated chaotic state)        │        │
│  └──────────────────────┬───────────────────────────────────┘        │
│                         │                                            │
│                         ▼                                            │
│  ┌──────────────────────────────────────────────────────────┐        │
│  │              Encryption Round 3-8                        │        │
│  │  (Continue for total of 8 rounds)                       │        │
│  └──────────────────────┬───────────────────────────────────┘        │
│                         │                                            │
│                         ▼                                            │
│  ┌──────────────┐                                                    │
│  │  Encrypted   │                                                    │
│  │   Image      │                                                    │
│  │  [256×256]   │                                                    │
│  └──────────────┘                                                    │
│                                                                      │
│  Key Parameters: x₀ = 0.3271, μ = 1.9999, rounds = 8                │
└─────────────────────────────────────────────────────────────────────┘

Component Breakdown

# Module Operation Input Output Parameters
1 MPHT Forward Pixel pair transformation [a, b] [α, β] p=10, mod=256
2 MPHT Inverse Reverse transformation [α, β] [a, b] p=10, mod=256
3 Skew Tent Map Chaotic keystream generation xₙ xₙ₊₁ μ=1.9999
4 XOR Operation Combine transformed images f, s r -
5 Chaotic Substitution Final encryption step r, keystream cipher -

Total Encryption Rounds: 8
Inference Time: ~50ms (256×256 image) | ~200ms (CPU Intel i7-12700)


3. ⚡ How It Works

🔄 Encryption Pipeline

TTEH-Net follows a strict four-step process for each encryption round:

Step 1: MPHT Transformation of Fingerprint Image

Original Fingerprint Image [256×256]
    ↓
Process pixel pairs (a, b) row-by-row
    ↓
Forward MPHT:
    α = (a + b + 10) mod 256
    β = (a + 2b + 10) mod 256
    ↓
Transformed Image f_trans [256×256]

Key Operations: - Pixel Pair Processing: Each adjacent pixel pair transformed independently - Modulo Arithmetic: Ensures values stay within 8-bit range [0, 255] - Reversibility: Mathematical inverse exists for perfect decryption - Diffusion: Each output pixel depends on two input pixels


Step 2: MPHT Transformation of Substitution Image

Substitution Image [256×256]
    ↓
Simple transformation: (img + 1) mod 256
    ↓
Forward MPHT on substitution → s_trans
    ↓
Substitution Transform s_trans [256×256]

Key Operations: - Simple Offset: Add 1 to create variation from original - Same MPHT: Apply identical forward transform - Preserves Structure: Maintains relationship with original - Enables XOR: Creates complementary transformation


Step 3: XOR Combination

f_trans (from Step 1)
    ↓
s_trans (from Step 2)
    ↓
XOR Operation:
    r = f_trans ⊕ s_trans
    ↓
Combined Result r [256×256]

Key Operations: - Bitwise XOR: Combines two transformed images - Information Mixing: Blurs relationship between original and substitution - Reversible: XOR with same value recovers original - Confusion: Increases cryptographic complexity


Step 4: Chaotic Substitution

Combined Result r [256×256]
    ↓
Chaotic Skew Tent Map:
    Generate keystream using x₀ = 0.3271, μ = 1.9999
    ↓
XOR with Keystream:
    cipher = r ⊕ keystream
    ↓
Update Chaotic State:
    xₙ₊₁ = μ × xₙ if xₙ < 0.5
    xₙ₊₁ = μ × (1 - xₙ) if xₙ ≥ 0.5
    ↓
Encrypted Image [256×256]

Key Operations: - Chaotic Generation: Skew tent map produces pseudo-random keystream - Sensitive Dependence: Small key changes produce completely different keystream - State Persistence: Chaotic state continues across rounds - Final Substitution: Last encryption step before next round


🎯 Decryption Process

Decryption reverses each encryption step in opposite order:

def decrypt(cipher, x0, mu, states, sub_data):
    for round in reversed(range(8)):
        # Reverse Step 4: Remove chaotic substitution
        keystream = generate_keystream(states[round])
        r = cipher ⊕ keystream

        # Reverse Step 3: Recover f_trans and s_trans
        f_trans, s_trans = reverse_xor(r, sub_data[round])

        # Reverse Step 2: Inverse MPHT on substitution
        substitution = mpht_inverse(s_trans)

        # Reverse Step 1: Inverse MPHT on fingerprint
        image = mpht_inverse(f_trans)

    return image  # Perfect recovery

Mathematical Guarantee: - MPHT Inverse: Exact reversal of forward transform - XOR Reversibility: Same keystream recovers original - State Synchronization: Same chaotic state sequence during decryption - Perfect Accuracy: decrypt(encrypt(img)) == img (100% success rate)


4. 📊 Security Metrics & Results

🎯 Test Configuration

  • Test Set: 80 synthetic fingerprint images (256×256)
  • Key Parameters: x₀ = 0.3271, μ = 1.9999 (from IEEE paper)
  • Encryption Rounds: 8 rounds per image
  • Evaluation Metrics: Entropy, NPCR, UACI, Correlation

🏆 Security Performance Summary

═══════════════════════════════════════════════════════════════════
  TTEH-Net Final Security Analysis Results
═══════════════════════════════════════════════════════════════════
  Entropy      : 7.9974 bits   (Ideal: 7.9972, Target: 8.0)
  NPCR         : 99.63%        (Ideal: 99.60%, Target: 99.61%)
  UACI         : 33.56%        (Ideal: 33.47%, Target: 33.46%)
  Correlation  : -0.0006       (Ideal: 0.0036, Target: ~0.0)

  Test Images  : 80 synthetic fingerprints
  Success Rate : 100% (perfect decryption accuracy)
  Encryption   : ~50ms per image (256×256)
═══════════════════════════════════════════════════════════════════

📈 Detailed Metric Analysis

Metric Our Result Paper Value Ideal Value Status
Entropy 7.9974 bits 7.9972 bits 8.0 bits ✅ Excellent
NPCR 99.63% 99.60% 99.61% ✅ Excellent
UACI 33.56% 33.47% 33.46% ✅ Excellent
Correlation -0.0006 0.0036 0.0 ✅ Excellent

Metric Explanations:

  • Entropy (7.9974 bits): Measures randomness in encrypted images. Perfect 8-bit images have entropy = 8.0. Our result of 7.9974 indicates near-ideal randomness, making statistical attacks infeasible.

  • NPCR (99.63%): Number of Pixels Change Rate - measures sensitivity to plaintext changes. Ideal is 99.61% for 8-bit images. Our 99.63% means changing one pixel in the original image changes 99.63% of pixels in the encrypted version, providing excellent differential attack resistance.

  • UACI (33.56%): Unified Average Changing Intensity - measures average intensity difference between encrypted images. Ideal is 33.46%. Our 33.56% shows strong avalanche effect.

  • Correlation (-0.0006): Measures relationship between adjacent pixels in encrypted image. Ideal is 0 (no correlation). Our -0.0006 indicates encrypted pixels are statistically independent

Core symbols most depended-on inside this repo

display_image
called by 4
src/gui.py
encrypt
called by 4
src/encryption.py
load_key
called by 4
src/encryption.py
mpht_forward
called by 3
src/mpht.py
create_image_panel
called by 3
src/gui.py
_correlation_for_direction
called by 3
src/metrics.py
generate_key
called by 3
src/encryption.py
main
called by 2
src/gui.py

Shape

Function 26
Method 22
Class 2

Languages

Python100%

Modules by API surface

src/gui.py19 symbols
src/encryption.py9 symbols
src/metrics.py7 symbols
run_analysis.py7 symbols
src/skew_tent.py6 symbols
src/mpht.py2 symbols

For agents

$ claude mcp add tteh-biometric-security \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page