EXPERIMENT_ID: 003

Steganography Tool

CONCEPT

LSB (Least Significant Bit) image steganography implementation in Go. Hides encrypted payloads within PNG pixel data.

OBJECTIVE

Implement a covert channel for data exfiltration by modifying the least significant bits of image pixel data.

CONSTRAINTS

Payload size limited by image dimensions. Not robust against compression.

Go Cryptography Image Processing
src/main.go
1
2package main
3
4import (
5 "image"
6 "image/color"
7)
8
9// EmbedHides payload bits into the LSB of image pixels
10func Embed(img image.Image, payload []byte) image.Image {
11 bounds := img.Bounds()
12 newImg := image.NewRGBA(bounds)
13
14 // ... bit manipulation logic ...
15
16 for y := bounds.Min.Y; y < bounds.Max.Y; y++ {
17 for x := bounds.Min.X; x < bounds.Max.X; x++ {
18 r, g, b, a := img.At(x, y).RGBA()
19
20 // Modify 'r' (red channel) LSB with payload bit
21 // r = (r & 0xFE) | next_bit
22
23 newImg.Set(x, y, color.RGBA{uint8(r), uint8(g), uint8(b), uint8(a)})
24 }
25 }
26 return newImg
27}
READ_ONLY_MODEUTF-8