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
12package main34import (5 "image"6 "image/color"7)89// EmbedHides payload bits into the LSB of image pixels10func Embed(img image.Image, payload []byte) image.Image {11 bounds := img.Bounds()12 newImg := image.NewRGBA(bounds)1314 // ... bit manipulation logic ...1516 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()1920 // Modify 'r' (red channel) LSB with payload bit21 // r = (r & 0xFE) | next_bit2223 newImg.Set(x, y, color.RGBA{uint8(r), uint8(g), uint8(b), uint8(a)})24 }25 }26 return newImg27}
READ_ONLY_MODEUTF-8