LSB Image Encoding: Replaces the least-significant bit of each R, G, B channel with one bit of your message. 3 bits per pixel = capacity of
β οΈ Always download as PNG β JPEG compression destroys LSBs.
W Γ H Γ 3 / 8 bytes. Visually identical, but mathematically different.
β οΈ Always download as PNG β JPEG compression destroys LSBs.
Encode
π Drop or click to upload cover image (PNG/JPEG)
No image loaded
Decode
π Drop or click to upload stego image
No image loaded
Comparison & Difference
Original
Stego
Diff Γ100 (modified pixels)
β
PSNR (dB)
β
Pixels Changed
β
Bytes Used
LSB Audio Encoding: Modifies the lowest bit of each 16-bit PCM sample. At 44.1 kHz mono, capacity is ~5.5 KB/sec. The change is below the noise floor β humans cannot hear it.
Encode
π Drop or click to upload WAV
Decode
π Drop or click to upload stego WAV
Audibility Test
β
PSNR (dB)
β
Samples Modified
β
Bytes Embedded
DCT-Domain Encoding: Embeds bits in mid-frequency DCT coefficients of 8Γ8 blocks (JPEG-style frequency domain). More robust than LSB β can survive light recompression and scaling. Each block carries 1 bit. Capacity is lower but resilience is much higher.
Demo: Encode β save as JPEG@90% β decode β verify the message survived.
Demo: Encode β save as JPEG@90% β decode β verify the message survived.
Encode (DCT)
π Drop or click to upload image
No image loaded
Decode (DCT)
π Drop or click to upload stego image (even JPEG)
No image loaded
25
How it works
Steganography is the art of hiding the existence of a message β different from cryptography, which hides the contents. This lab demonstrates three techniques:
- LSB Image: Each pixel byte's last bit is replaced with one message bit. The visual difference between value 200 and 201 is imperceptible β but 200 is even (bit 0) and 201 is odd (bit 1). Multiply across a million pixels and you get hundreds of KB of hidden capacity.
- LSB Audio: Same idea but on 16-bit PCM samples. Audio capacity is large because every sample carries one bit; even short clips hold tens of KB.
- DCT Domain: The 8Γ8 Discrete Cosine Transform decomposes a block into frequency components. We modify mid-frequency coefficients (skipping DC and high freq) by quantizing them to a parity. Survives JPEG compression because compression preserves these frequencies.
Payload format
[ "STEGO\0" β 6 byte magic ][ length β 4 bytes BE ][ flag β 1 byte (0=plain, 1=AES-GCM) ][ payload β N bytes ]
For AES-GCM, the payload is [12-byte IV | ciphertext+tag]. The key is derived from the passphrase via PBKDF2-SHA-256 (200k iterations, fixed salt for reproducibility).
Tips
- Save stego images as PNG, not JPEG β JPEG destroys LSB data.
- Use higher-resolution covers for longer messages β capacity scales with pixel count.
- Encryption + steganography = strong protection: even if someone suspects a hidden message, they can't read it without the passphrase.
- DCT can survive JPEG@90% reasonably well, but not aggressive compression or heavy resizing.