Inspiration

Our project, DCTStegoGuard, was inspired by the growing need for secure communication and digital privacy. With the rise of social media and digital image sharing, sensitive information can be exposed if not properly protected. Steganography, hiding data inside images, is a fascinating field because it allows messages to be hidden in plain sight, blending naturally with normal image data. We were particularly inspired by JPEG images, which use Discrete Cosine Transform (DCT) for compression. Unlike simple pixel-based hiding, DCT-based steganography works in the frequency domain, making it more resistant to compression and detection. We wanted to explore both hiding data securely and detecting hidden messages using machine learning and frequency analysis.

What it does

1/ Discrete Cosine Transform (DCT) of image pixels \f(x,y)\ the 2D DCT is computed as: $$F(u,v)=41​α(u)α(v)x=0∑7​y=0∑7​f(x,y)cos(16(2x+1)uπ​)cos(16(2y+1)vπ​)$$

This transforms spatial pixels into frequency coefficients, where: \𝐹 ( 0 , 0 )\ = DC coefficient (overall brightness) Mid-frequency coefficients = best for hiding data High-frequency coefficients = more fragile under compression

2/ Quantization JPEG compresses by dividing each coefficient by a quantization table 𝑄 ( 𝑢 , 𝑣 )

3/ Data Embedding We hide a secret bit 𝑏 in the least significant bit (LSB) of a coefficient 𝐶

4/Inverse DCT (Reconstruction) After embedding, we can apply the inverse DCT to reconstruct the image and get the hidden message

How we built it

Image Preprocessing: Convert JPEG to YCbCr color space. Split the Y (luminance) channel into 8×8 blocks.

DCT Transformation Apply 2D DCT to each block using the formula above. Extract mid-frequency coefficients for embedding.

Data Embedding (Steganography) Convert secret data into a binary sequence. Modify LSB of selected DCT coefficients :

Image Reconstruction Apply inverse DCT and combine blocks. Save as JPEG - hidden message remains intact.

Detection Module Extract DCT coefficients from test images. Use pattern analysis classifier to predict hidden data presence and also by using Gemini API.

Challenges we ran into

Maintaining image quality: Overwriting too many coefficients caused visible artifacts. We had to carefully select mid-frequency coefficients.

JPEG compression effects: Some bits were lost during compression. Solution: embed in coefficients that are stable under quantization.

Accomplishments that we're proud of and What we learned

frequency-domain steganography is more secure and robust than simple pixel-based methods. Understanding DCT math is crucial for both hiding and detecting data. Combining code + image processing taught us real-world applications of digital forensics. Small changes in the frequency domain can hide messages in plain sight, which is powerful for privacy, watermarking, and security research. This project Designed and implemented a DCT-based steganography system capable of encoding (embedding) and decoding (extracting) hidden payloads inside images, followed by automated forensic analysis to detect potentially malicious content. The project demonstrates how attackers may hide commands in images and how defenders can safely uncover and analyze them.

What's next for DCTStegoGuard

Implement ML-based Detection Train convolutional neural networks (CNNs) or other deep learning models on DCT coefficient patterns to detect steganography with higher accuracy.

Built With

Share this project:

Updates