Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
- [Setup](#setup)
- [Run with Streamlit Application](#run-with-streamlit-application)
- [Usage](#usage)
- [API Endpoints](#api-endpoints)
- [Security Limitations](#security-limitations)
- [Technical Implementation](#technical-implementation)

## Overview
This project implements a web-based image encryption system using cryptographically secure Linear Feedback Shift Register (LFSR) techniques. Users can upload images, configure encryption parameters, and receive encrypted and decrypted versions in real-time.
This project implements a web-based image encryption demonstration using Linear Feedback Shift Register (LFSR) techniques. Users can upload images, configure encryption parameters, and receive encrypted and decrypted versions in real-time.


## Architecture
Expand Down Expand Up @@ -50,8 +52,8 @@ LFSR_Image_Encryption_System/

## Features

- **LFSR-based encryption**: Implements confusion and diffusion principles for strong image encryption
- **Configurable parameters**: Adjustable seed values and tap positions for different security levels
- **LFSR-based encryption**: Demonstrates confusion and diffusion principles for image encryption
- **Configurable parameters**: Adjustable seed values and tap positions for experimentation
- **Interactive web interface**: User-friendly Streamlit frontend
- **Real-time processing**: Immediate encryption/decryption visualization
- **Downloadable results**: Save encrypted and decrypted images
Expand Down Expand Up @@ -115,6 +117,35 @@ LFSR_Image_Encryption_System/
- 32-bit LFSR: 32,22,2,1
- 64-bit LFSR: 64,63,61,60

## API Endpoints

The FastAPI backend exposes the following multipart form endpoints.

### `POST /api/encrypt`

Encrypts an uploaded image and returns the encrypted image data plus an `encryption_id` used for later decryption.

Required form fields:

- `image`: image file uploaded as multipart form data.
- `seed`: integer initial state for the LFSR.
- `tap_positions`: comma-separated tap positions, for example `16,15,13,4`.
Comment on lines +130 to +132

### `POST /api/decrypt`

Decrypts an encrypted image using a previously returned `encryption_id`.

Required form fields:

- `encryption_id`: identifier returned by `POST /api/encrypt`, used to retrieve the stored decryption metadata.
- Encrypted image input, provided as one of:
Comment on lines +139 to +141
- `image`: encrypted image file uploaded as multipart form data, or
- `encrypted_base64`: base64-encoded encrypted image data.

## Security Limitations

This project is intended for education and demonstration only. LFSR output is deterministic: the same seed and tap positions generate the same keystream, which makes this approach unsuitable for production-grade cryptography. Do not use this implementation to protect sensitive, confidential, or production data.

## Technical Implementation
### Encryption Process
1. **Confusion Layer**:
Expand Down