# Image Steganography Embed & Detect

Hide text in a PNG's least-significant bits, extract it back, and run the Westfeld–Pfitzmann chi-square steganalysis with a falling-p curve and LSB plane preview.

> Canonical page: https://elysiatools.com/en/tools/image-steganography-embed-detect

- **Category:** Security

- **Keywords:** steganography, lsb steganography, hide message in picture, steganalysis, chi square attack, png hidden text, stego tool

## Overview

Embedding writes UTF-8 bytes into the LSBs of each pixel's channels in the interoperable order (row-major, R→G→B, MSB-first — the same convention CyberChef's “Extract LSB” and StegOnline read), framed by a 12-byte STG1 header (magic + flags + 32-bit big-endian length) so extraction is self-describing and clean images almost never false-positive. A scatter seed switches to a seeded Fisher–Yates permutation of the sample stream (cyrb128 + mulberry32): sequential tools then read only noise, and the chi-square falling curve flattens. Transparent pixels are skipped by default because browsers' premultiplied-alpha pipelines treat fully-transparent RGB as don't-care and can destroy hidden bits on re-save; the output PNG is bit-exact elsewhere (LSB replacement changes each touched sample by at most 1). Detection computes the chi-square statistic over PoV pairs (2k, 2k+1) per channel — embedded data equalizes each pair's histogram — with the p-value from the regularized incomplete gamma function, applied over sliding prefixes (1%…100%) to localize where a sequential message ends, plus an LSB bit-plane preview and LSB entropy. Educational/CTF scope: this is not encryption, and scattering's 32-bit seed is brute-forceable.

## Inputs

- **PNG image** (file)
- **Mode** (select)
- **Secret message (embed mode)** (textarea): The message to hide inside the pixels…
- **Scatter seed (optional)** (text): leave empty for sequential embedding
- **Channels** (select)
- **Skip transparent pixels** (checkbox)

## When to use

- Concealing text payloads or flags inside lossless PNG images for CTF challenges and educational demonstrations.
- Recovering hidden text messages and STG1 headers from suspect PNG files using sequential or seeded extraction.
- Inspecting PNG images for sequential LSB manipulation using sliding chi-square p-value curves, bit plane previews, and entropy statistics.

## How it works

- Upload a PNG image and select your desired mode: embed, extract, or analyze.
- For embedding, input your secret text and configure optional parameters like channel selection (RGB/RGBA), transparent pixel skipping, and a scatter seed for Fisher–Yates bit permutation.
- In extract mode, retrieve the UTF-8 payload framed by the STG1 header, or in analyze mode, evaluate chi-square statistics across Pairs of Values (PoVs) and inspect the LSB bit plane.

## Use cases

- Creating steganography challenges for cybersecurity competitions and university security labs.
- Performing forensic triage on suspicious PNG files using chi-square steganalysis and LSB bit-plane visualizers.
- Transporting plain text notes inside lossless PNG files without modifying noticeable image aesthetics.

## Frequently asked questions

### Does embedding text alter the visual appearance of the image?

No, LSB replacement alters pixel color values by at most 1 unit per channel, making changes visually imperceptible.

### Why are transparent pixels skipped by default?

Browser graphics pipelines often discard RGB data in fully transparent pixels, which would corrupt hidden LSB bits upon re-saving.

### What is the STG1 header?

It is a 12-byte framing header containing magic bytes, flags, and payload length that makes extraction self-describing and prevents false positives.

### How does the scatter seed affect extraction and steganalysis?

A seed permutes sample indices with Fisher–Yates, turning sequential LSB patterns into noise and flattening chi-square detection curves.

### Is LSB steganography equivalent to strong encryption?

No, steganography hides the existence of data rather than encrypting it, and 32-bit scatter seeds can still be brute-forced.

## Related tools

- [Accessibility Checker](https://elysiatools.com/en/tools/accessibility-checker): Detect common WCAG 2.1 accessibility issues in HTML, fetched pages, or design images and return fix-ready guidance
- [VP8 Image Analyzer](https://elysiatools.com/en/tools/vp8-image-analyzer): Analyze a WebP/VP8 image with Sharp, generate a grayscale displacement map, and render it as an interactive Three.js 3D relief surface
- [AI Image to Markdown](https://elysiatools.com/en/tools/ai-image-to-markdown): Extract text from images and convert to markdown format using AI vision models
- [Image Channel Extractor](https://elysiatools.com/en/tools/image-channel): Extract, manipulate, and analyze individual color channels (RGB, Alpha, Luminance) with professional processing options
- [Image Color Extractor](https://elysiatools.com/en/tools/image-color-extractor): Extract dominant colors from images using various algorithms including k-means clustering and histogram analysis
- [QR Code Decoder](https://elysiatools.com/en/tools/qr-code-decoder): Decode QR codes from images and extract the contained text or URLs
- [Image Metadata Extractor](https://elysiatools.com/en/tools/image-metadata): Extract comprehensive metadata from images including EXIF, IPTC, XMP, and technical information
- [Batch Podcast Publisher Pack](https://elysiatools.com/en/tools/audio-batch-podcast-publisher-pack): Normalize a batch of podcast episodes, apply metadata and chapters, and package validated delivery files in one ZIP.

## Samples

- [Web Image Processing Go Samples](https://elysiatools.com/en/samples/web-image-processing-go): Web Go image processing examples including image reading/saving, image resizing, and format conversion
- [Web Image Processing Python Samples](https://elysiatools.com/en/samples/web-image-processing-python): Web Python image processing examples using PIL/Pillow including reading, saving, resizing, and format conversion
- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion

## Related content

- [Text Analysis, Readability, and Content Inspection Tools](https://elysiatools.com/en/hubs/text-analyze): Compare text statistics, language detection, readability scoring, sentiment analysis, moderation review, and pattern analysis tools in one hub.
- [Image Format Conversion and Animated Export Tools](https://elysiatools.com/en/hubs/image-convert): Compare image format converters for JPG, PNG, GIF, AVIF, WebP, TIFF, ICO, base64, and animation-friendly exports in one hub.
- [Text Case, Encoding, and Normalization Conversion Tools](https://elysiatools.com/en/hubs/text-convert): Compare text case conversion, character-width conversion, encoding conversion, quoted-printable handling, and inline text normalization tools in one hub.
- [Image Cleanup, Framing, and Batch Prep Tools](https://elysiatools.com/en/hubs/image-utility): Compare image cleanup, trimming, padding, framing, batch resize/compress, watermarking, and visual polish tools in one hub for asset preparation workflows.
