Skip to content

sayednowshad/StegoChat-Secure-Messenger-SpringBoot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ StegoShield Gateway ⚡

Blocking & Detecting Hidden Malicious Data Inside Images

A Spring Boot Security Gateway for Detecting LSB-Based Steganography Before Image Delivery


Java Spring Boot Maven PostgreSQL Security

⚡ Technology Stack ⚡

Category Technology Purpose
Programming Language Java 17 Core application development
Framework Spring Boot REST API & Security Gateway
Build Tool Maven Dependency management and project build
Image Processing BufferedImage, ImageIO Read and analyze uploaded images
Steganography Detection Least Significant Bit (LSB) Extract hidden binary information
Entropy Analysis Shannon Entropy Detect suspicious randomness
Signature Detection Binary Signature Scanner Detect embedded ZIP, EXE, ELF, PDF and more
Payload Analysis Payload Reconstruction Decode and inspect extracted payload
Database PostgreSQL / H2 Store logs and application data
API Testing Postman REST API testing and validation
Logging SLF4J / Logback Security monitoring and application logs
Version Control Git & GitHub Source code management

Phase 01 • Existing Chat Application Workflow

flowchart LR

A["User A"]
B["Upload Image"]
C["Chat Server"]
D["Store Image"]
E["Forward Image"]
F["User B"]

A --> B
B --> C
C --> D
D --> E
E --> F
Loading

Phase 02 • What Happens With a Malicious Image?

flowchart LR

A["Attacker"]

B["Image with Hidden LSB Payload"]

C["Chat Server"]

D["Image Stored"]

E["Image Delivered"]

F["Victim"]

A --> B
B --> C
C --> D
D --> E
E --> F

style B fill:#ff4d4d,color:#000000,stroke:#b30000,stroke-width:3px
style C fill:#ffe6e6,color:#000000
style D fill:#ffe6e6,color:#000000
style E fill:#ffe6e6,color:#000000
style F fill:#ff4d4d,color:#000000,stroke:#b30000,stroke-width:3px
Loading

Phase 03 • StegoShield Solution

flowchart LR

A["User A"]

B["Upload Image"]

C["StegoShield Gateway"]

D["Security Analysis"]

E{"Image Safe?"}

F["Forward Image"]

G["Reject Upload"]

H["User B"]

A --> B
B --> C
C --> D
D --> E

E -->|YES| F
F --> H

E -->|NO| G

style F fill:#90EE90,color:#000000
style G fill:#ff6666,color:#000000
Loading

Phase 04 • Complete System Architecture

flowchart TD

UA["Sender"]

UPLOAD["Upload API"]

GATEWAY["StegoShield Gateway"]

BUFFER["BufferedImage Reader"]

LSB["LSB Analyzer"]

ENTROPY["Entropy Calculator"]

SIGNATURE["Binary Signature Scanner"]

PAYLOAD["Payload Decoder"]

ENGINE["Decision Engine"]

ALLOW["Forward Image"]

BLOCK["Reject Upload"]

LOG["Security Log"]

USERB["Receiver"]

UA --> UPLOAD
UPLOAD --> GATEWAY

GATEWAY --> BUFFER

BUFFER --> LSB
BUFFER --> ENTROPY
BUFFER --> SIGNATURE
BUFFER --> PAYLOAD

LSB --> ENGINE
ENTROPY --> ENGINE
SIGNATURE --> ENGINE
PAYLOAD --> ENGINE

ENGINE -->|Safe| ALLOW
ENGINE -->|Malicious| BLOCK

ALLOW --> USERB

ENGINE --> LOG
BLOCK --> LOG
Loading

Phase 05 • Image Analysis Pipeline

flowchart TD

A["Image Upload"]

B["Validate Request"]

C["Read Image (BufferedImage)"]

D["Extract Pixels"]

E["Extract RGB Values"]

F["Extract Least Significant Bits"]

G["Generate Bit Stream"]

H["Calculate Shannon Entropy"]

I["Scan Binary Signatures"]

J["Attempt Payload Reconstruction"]

K["Generate Analysis Report"]

A --> B
B --> C
C --> D
D --> E
E --> F
F --> G
G --> H
H --> I
I --> J
J --> K
Loading

Phase 06 • Detection Engine

flowchart TD

IMG["Uploaded Image"]

LSB["LSB Score"]

ENT["Entropy Score"]

SIG["Signature Detection"]

PAY["Payload Confidence"]

IMG --> LSB
IMG --> ENT
IMG --> SIG
IMG --> PAY

LSB --> SCORE

ENT --> SCORE

SIG --> SCORE

PAY --> SCORE

SCORE["Combined Risk Score"]

SCORE --> DECISION{"Risk Threshold"}

DECISION -->|Low| SAFE["Safe"]

DECISION -->|High| MAL["Malicious"]
Loading

Phase 07 • Decision Logic

flowchart TD

START["Image Uploaded"]

LSB["LSB Analysis"]

ENTROPY["Entropy Analysis"]

SIGNATURE["Signature Detection"]

PAYLOAD["Payload Reconstruction"]

START --> LSB
START --> ENTROPY
START --> SIGNATURE
START --> PAYLOAD

LSB --> SCORE

ENTROPY --> SCORE

SIGNATURE --> SCORE

PAYLOAD --> SCORE

SCORE["Risk Score"]

SCORE --> THRESHOLD{"Threshold"}

THRESHOLD -->|Low Risk| ALLOW["Allow Upload"]

THRESHOLD -->|High Risk| REJECT["Reject Upload"]

style ALLOW fill:#90EE90,color:#000000
style REJECT fill:#ff6666,color:#000000
Loading

Phase 08 • Internal Processing Workflow

sequenceDiagram

participant Sender

participant Gateway

participant Analyzer

participant DecisionEngine

participant Receiver

Sender->>Gateway: Upload Image

Gateway->>Analyzer: Read BufferedImage

Analyzer->>Analyzer: Extract Pixel Data

Analyzer->>Analyzer: LSB Extraction

Analyzer->>Analyzer: Entropy Analysis

Analyzer->>Analyzer: Signature Detection

Analyzer->>Analyzer: Payload Reconstruction

Analyzer->>DecisionEngine: Analysis Report

DecisionEngine-->>Gateway: SAFE

Gateway-->>Receiver: Deliver Image
Loading

Phase 09 • Threat Detection & Temporary Blocking Workflow

flowchart TD

A["Threat Detected"] --> B["Reject Upload"]

B --> C["Store Security Log"]

C --> D["Increment User Violation Count"]

D --> E["Temporarily Block User Uploads<br/>(3 Minutes)"]

E --> F["Block Timer Starts"]

F --> G{"3 Minutes Completed?"}

G -->|No| H["Keep User Blocked"]

H --> F

G -->|Yes| I["Restore Upload Access"]

I --> J["User Can Upload Again"]

style A fill:#ff6666,color:#000000,stroke:#b30000,stroke-width:2px
style B fill:#ff9999,color:#000000
style C fill:#ffe699,color:#000000
style D fill:#ffd966,color:#000000
style E fill:#ff4d4d,color:#000000,stroke:#b30000,stroke-width:2px
style I fill:#90EE90,color:#000000
style J fill:#90EE90,color:#000000
Loading

⚡ Images ⚡

• Payload Image Creation



• Payload Incident Data



• Block Status View



• Payload Detection Result



• Temporary User Blocking



• Clean Image Detection



• PostgreSQL Incident Database



• Incident Log API



• Security Report API



• Scan Result Summary



• Frontend Integration