Image Steganography on Kali Linux: Hide Messages with Steghide

Deepak Prasad
Tested on Kali GNU/Linux Rolling 2026.2 (kali-rolling)
Package steghide 0.5.1+git20240220-2
stegosuite 0.9.0-1
imagemagick 8:7.1.2.27+dfsg1-1
Applies to Kali Linux
Lab environment Local steganography workspace on Kali — no network target required
Privilege Normal user for embed and extract; sudo for package installs
Scope Hide and recover text with steghide on JPEG, inspect capacity and encryption with steghide info, compare Stegosuite GUI and CLI on PNG, and note OpenStego as a cross-platform alternative. Does not cover steganalysis detection, EXIF-only metadata, or malware delivery chains.
Related guides Pentest lab setup

Image steganography lets you ship a secret inside an ordinary photo. In an ethical hacking lab you practice embed and extract workflows before defenders hunt the same artifacts with forensics tooling.

This guide walks through steghide on the command line (primary), Stegosuite on Kali desktop or CLI for PNG, and a short note on OpenStego for readers who want a Java GUI on other platforms. Every steghide command and output below was captured on Kali Rolling 2026.2.

IMPORTANT
Hide data only in files you own or are explicitly authorized to test. Do not use steganography to exfiltrate data from employers, clients, or third-party systems without written permission.

What is image steganography in ethical hacking?

Steganography hides a payload inside a carrier file. Cryptography protects content; steganography hides the fact that a second message exists. Attackers have used image stego in phishing attachments and forum posts; defenders look for size anomalies, statistical tests, and known tool signatures.

In a lab you typically:

  • Pick a cover image (JPEG or PNG)
  • Write a short secret file or message
  • Embed with a passphrase or AES key
  • Share only the stego image
  • Recover the payload with the same tool and secret

That differs from EXIF metadata parsing, which reads camera fields already stored in the file header. Steganography adds or manipulates payload bytes inside the image container. Forensic teams may still detect it during disk or memory analysis when file sizes or entropy shift.


Compare steganography tools

Kali ships CLI and GUI options. Pick based on format support and whether you need a terminal-only workflow.

Tool Interface Cover formats Encryption Best for
steghide CLI JPEG, BMP, WAV, AU Rijndael-128 CBC (default) Scriptable JPEG labs and CTF-style embed or extract
Stegosuite GUI + CLI BMP, GIF, JPG, PNG AES Desktop labs; PNG embed works headless on Kali CLI
OpenStego GUI (Java) BMP, GIF, JPG, PNG AES (configurable) Cross-platform GUI when Stegosuite is not installed

This article tests steghide end to end on JPEG, then Stegosuite on PNG. OpenStego follows the same mental model—cover file, secret, passphrase, output stego file—but installs from the OpenStego GitHub releases page when you need it outside Kali packages.


Kali lab setup

Create one workspace with a cover image and a text payload. You reuse the same paths for embed, info, and extract steps.

Set lab variables once:

bash
STEG_LAB="${HOME}/steg-lab"
COVER="${STEG_LAB}/cover.jpg"
SECRET="${STEG_LAB}/secret.txt"
STEGO="${STEG_LAB}/cover-stego.jpg"
STEG_PASS='LabSteg2026!'
bash
mkdir -p "${STEG_LAB}"

Build a simple JPEG cover with ImageMagick so you do not depend on an external download:

bash
convert -size 400x300 xc:'#4a90d9' -fill white -pointsize 24 -gravity center -annotate 0 'Steganography lab cover' "${COVER}"

Write the message you will hide:

bash
printf '%s\n' 'GoLinuxCloud steganography lab message — authorized test only.' > "${SECRET}"

Confirm the lab files exist:

bash
ls -lh "${STEG_LAB}/"

Sample output:

output
total 12K
-rw-r--r-- 1 kali kali 8.0K ... cover.jpg
-rw-r--r-- 1 kali kali   65 ... secret.txt

An 8 KB JPEG with a 65-byte text file is enough to exercise capacity checks and passphrase-protected embed on Kali.


Install steghide and Stegosuite on Kali

Both tools are in Kali repositories. ImageMagick is optional but useful for generating lab covers. Install them with apt command.

bash
sudo apt update
bash
sudo apt install -y steghide stegosuite imagemagick

Verify package versions:

bash
dpkg-query -W -f='${Package} ${Version}\n' steghide stegosuite imagemagick

Sample output:

output
imagemagick 8:7.1.2.27+dfsg1-1
steghide 0.5.1+git20240220-2
stegosuite 0.9.0-1
bash
steghide --version

Sample output:

output
steghide version 0.6.0

The binary reports 0.6.0 while the Debian package tracks the git snapshot above—both refer to the same Kali build.


Embed a secret message with steghide

steghide compresses and encrypts the payload, then writes a new stego file. Pass the passphrase on the command line in the lab so the walkthrough is non-interactive; on your own machine you can omit -p and type it at the prompt.

bash
steghide embed -cf "${COVER}" -ef "${SECRET}" -sf "${STEGO}" -p "${STEG_PASS}" -f

Sample output:

output
embedding "/home/kali/steg-lab/secret.txt" in "/home/kali/steg-lab/cover.jpg"... done
writing stego file "/home/kali/steg-lab/cover-stego.jpg"... done

Compare file sizes—the stego copy is slightly larger even though both images look the same in a viewer:

bash
ls -lh "${COVER}" "${STEGO}"

Sample output:

output
-rw-r--r-- 1 kali kali 8.0K ... /home/kali/steg-lab/cover.jpg
-rw-r--r-- 1 kali kali 9.7K ... /home/kali/steg-lab/cover-stego.jpg

That size delta is a common defender signal. In a report, note both the visual similarity and the byte growth.


Inspect stego files with steghide info

steghide info reports format, remaining capacity, and embedded file metadata when data is present. Supply the passphrase with -p on stego files so the command does not hang on an interactive prompt.

bash
steghide info "${STEGO}" -p "${STEG_PASS}"

Sample output:

output
"cover-stego.jpg":
  format: jpeg
  capacity: 542.0 Byte
  embedded file "secret.txt":
    size: 65.0 Byte
    encrypted: rijndael-128, cbc
    compressed: yes

The embedded name secret.txt, encryption algorithm, and compressed flag are the fields you paste into lab notes. List supported ciphers when you need to document alternatives:

bash
steghide encinfo | head -8

Sample output:

output
encryption algorithms:
<algorithm>: <supported modes>...
cast-128: cbc cfb ctr ecb ncfb nofb ofb
gost: cbc cfb ctr ecb ncfb nofb ofb
rijndael-128: cbc cfb ctr ecb ncfb nofb ofb
twofish: cbc cfb ctr ecb ncfb nofb ofb
arcfour: stream
cast-256: cbc cfb ctr ecb ncfb nofb ofb

Default embed uses Rijndael-128 CBC unless you pass -e none to skip encryption (not recommended for real secrets).


Extract hidden data with steghide

The recipient needs the stego file and the same passphrase. steghide writes the recovered payload to -xf.

bash
steghide extract -sf "${STEGO}" -xf "${STEG_LAB}/recovered.txt" -p "${STEG_PASS}" -f

Sample output:

output
wrote extracted data to "/home/kali/steg-lab/recovered.txt".
bash
cat "${STEG_LAB}/recovered.txt"

Sample output:

output
GoLinuxCloud steganography lab message — authorized test only.

A matching line confirms embed and extract succeeded. Test a wrong passphrase to see the failure mode defenders log during brute-force attempts:

bash
steghide extract -sf "${STEGO}" -xf "${STEG_LAB}/bad.txt" -p 'wrongpass' -f

Sample output:

output
steghide: could not extract any data with that passphrase!

Record that error when analysts test leaked stego images with a wordlist.


Hide messages with Stegosuite on Kali

Stegosuite bundles a Swing GUI and subcommands for embed, extract, and capacity. On a Kali desktop session, launch the GUI:

bash
stegosuite gui

Drag your cover image into the window, enter a text message and secret key, then click Embed. The tool writes a new image beside the original. Extraction uses the same key on the stego file through the GUI Extract tab.

For terminal-only labs, PNG covers embed cleanly without a display server. JPG embedding in Stegosuite 0.9 expects AWT display support on Kali—use steghide for JPEG or run Stegosuite GUI on a desktop Kali VM.

Create a PNG cover and embed a short message from the CLI:

bash
PNG_COVER="${STEG_LAB}/cover.png"
PNG_STEGO="${STEG_LAB}/cover-stegosuite.png"
convert -size 400x300 xc:'#2d6a4f' -fill white -pointsize 24 -gravity center -annotate 0 'PNG steg lab' "${PNG_COVER}"
bash
stegosuite embed -k "${STEG_PASS}" -m 'Stegosuite CLI lab message — authorized test.' -o "${PNG_STEGO}" "${PNG_COVER}"

Sample output:

output
Loading png image from /home/kali/steg-lab/cover.png
Embedding data...
Saving png image to /home/kali/steg-lab/cover-stegosuite.png

Check how much data the PNG can hold before you embed larger files:

bash
stegosuite capacity "${PNG_COVER}"

Sample output:

output
Loading png image from /home/kali/steg-lab/cover.png
Capacity: 501 B

The capacity line tells you how much text or file data the PNG can absorb before embed fails. Use the GUI to extract PNG payloads when CLI extract hits display limitations on your session—the embed step above already proves Stegosuite accepts the same key and message format on Kali packages.


OpenStego as a cross-platform option

OpenStego is a Java GUI steganography tool for Linux, macOS, and Windows. The workflow mirrors Stegosuite: choose a secret file or message, pick a cover image, set a password, and generate an output stego file. Extraction asks for the stego file and password and restores the hidden payload.

Kali does not ship OpenStego in the default repos this refresh used, so install it from the official GitHub release when you need that UI on a non-Kali workstation. For Kali-only labs, steghide plus Stegosuite cover the same learning goals without a separate installer.


Steganography troubleshooting

Symptom Likely cause Fix
steghide: could not extract any data with that passphrase! Wrong or missing passphrase Retry with the exact -p value from embed; check shell history for typos
steghide: the file format ... is not supported Cover type not in JPEG/BMP/WAV/AU set Convert the cover to JPEG with convert or pick a supported format
Embed fails with capacity error Payload larger than free stego space Run steghide info on the cover; shorten the secret or use a larger image
steghide: could not get terminal attributes Non-interactive shell during info on empty cover Pass -p on stego files only, or run info from a full terminal
Stegosuite JPG embed HeadlessException No X11 display for JPG encoder Use steghide for JPEG, or run stegosuite gui on desktop Kali
Stego image looks identical but mail filters flag it Size or entropy change Expected for naive stego; defenders compare hashes and statistics

References


Summary

You set up a steg-lab workspace on Kali, installed steghide and Stegosuite, and hid a text file inside a JPEG using steghide embed with Rijndael-128 encryption. steghide info showed embedded filename, size, and cipher details, and steghide extract recovered the original message when the passphrase matched.

Stego files often grow by a few kilobytes even when viewers see no visual change—that byte delta matters for blue teams. Stegosuite adds a GUI path and CLI embed for PNG on the same host; OpenStego remains a sensible cross-platform alternative when you are not on Kali packages.

Treat steganography as concealing presence, not invincibility. Pair embed and extract practice with the EXIF and forensic imaging workflows covered earlier in this guide. Optional compression with tar before embed can shrink payloads when capacity is tight.


Frequently Asked Questions

1. What is image steganography?

Image steganography hides data inside a cover image so the picture still looks normal to casual viewers. The payload is often encrypted and compressed before it is embedded in JPEG or PNG container space. Detection requires steganalysis tools or knowing which algorithm and passphrase were used.

2. Which image formats work with steghide on Kali?

Steghide supports JPEG, BMP, WAV, and AU cover files. This lab uses JPEG. Capacity depends on image resolution and entropy in the file—steghide info reports how many bytes you can embed before you run embed.

3. Can anyone extract my hidden message?

Extraction needs the same tool family, the correct stego file, and the passphrase or key you set at embed time. A wrong passphrase fails with steghide. Stegosuite uses AES with your secret key. Neither tool makes the data invisible to forensic analysts who run dedicated steganalysis.

4. Why did my stego image grow in size?

Embedded bytes, encryption overhead, and compression metadata increase file size even when the picture looks identical. Compare ls -lh on the cover and stego files—small text payloads usually add a modest bump, which is a clue for defenders.

5. Is hiding messages in images legal?

Steganography is a legitimate privacy and security technique when you own the files or have permission to test. Concealing data to evade law enforcement or workplace policy on systems you are not authorized to assess can violate laws and contracts. Use training images in an isolated lab only.
Kennedy Muthii

Information Security Analyst

Accomplished professional proficient in Python, ethical hacking, Linux, cybersecurity, and OSINT. With a track record including winning a national cybersecurity contest, launching a startup in Kenya, and holding a degree in information science, he is currently engaged in cutting-edge research in ethical hacking.

  • Python (programming language)
  • Certified Ethical Hacker
  • White Hat (Computer Security)
  • Linux
  • Penetration Testing