advancedcat/stego~2 min read
DCT & Frequency Domain Steganography
Detect and extract hidden payloads from JPEG Discrete Cosine Transform (DCT) coefficients and audio Fourier transforms using Jsteg and OutGuess.
// prerequisite reading
Spatial vs. Frequency Domain Steganography
- Spatial Domain (PNG / BMP / WAV): Data is hidden directly in pixel RGB color values or raw PCM audio samples (e.g., LSB replacement). Easily detected by histogram analysis (
zsteg). - Frequency Domain (JPEG / MP3): Data is converted into frequency coefficients using mathematical transforms (Discrete Cosine Transform (DCT) or Fast Fourier Transform (FFT)) before lossy compression.
1. JPEG DCT Steganography (Jsteg)
JPEG compression divides images into $8 \times 8$ pixel blocks, applies DCT to convert pixels into frequency coefficients, and quantizes the coefficients.
Jsteg embeds secret data into the LSBs of non-zero quantized DCT coefficients:
# Extract hidden data using jsteg
jsteg reveal input.jpg extracted_secret.txt
# Embed payload into JPEG
jsteg hide input.jpg payload.txt output_stego.jpg
2. OutGuess Steganography
OutGuess is a universal steganographic tool that embeds secret data into redundant bits of coefficients while preserving original statistics and coefficient histograms to defeat steganalysis detection algorithms.
# Extract hidden message with optional password
outguess -k "secretpass" -r input.jpg extracted_output.txt
3. StegDetect & StegBreak
stegdetect automates statistical detection of steganographic content in JPEG files (Jsteg, OutGuess, JPHide, F5):
# Scan JPEG images for stego signatures
stegdetect -s 10.0 *.jpg
# Brute-force dictionary attack against OutGuess or JPHide
stegbreak -r rules.ini -f wordlist.txt -t jphide input.jpg