Steg-Go is a powerful command-line tool that lets you hide encrypted messages inside ordinary images. Using advanced Least Significant Bit (LSB) Steganography combined with AES-256 encryption, it provides a secure way to conceal sensitive information in plain sight.
- โ Undetectable to the human eye - Modifies only the least significant bits
- โ Double-layer protection - Steganography + encryption
- โ Format preservation - Maintains image quality
- โ Cross-platform - Works on Linux, macOS, and Windows
๐ฆ Unix/Linux/MacOS
# Clone the repository
git clone https://github.com/pranaykumar2/steg-go.git
cd steg-go
# Build and run
chmod +x build.sh
./build.sh
./stego info
๐ช Windows
-
Install Go from golang.org/dl
-
Clone the repository
git clone https://github.com/pranaykumar2/steg-go.git cd steg-go
-
Build the application
go mod tidy go build -o stego.exe ./cmd/stego
-
Run Steg-Go
.\stego.exe info
๐ก Windows Batch File (Optional)
Create build.bat
with the following content:
@echo off
echo Building Steganography Tool - Initial Setup...
echo Tidying Go modules...
go mod tidy
echo Building application...
go build -v -o stego.exe ./cmd/stego
if %ERRORLEVEL% EQU 0 (
echo Build successful! Run: .\stego.exe
) else (
echo Build failed! Check for errors.
exit /b 1
)
Run: build.bat
./stego hide
๐ Example Session
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Secure Image Steganography Tool โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Current Time (UTC): 2025-03-01 09:41:34
User: runner
โ Enter input image path (PNG or JPG):
sample.jpg
โ Enter output image path (will be saved as PNG):
sample-hidden.png
โ Enter the secret message:
This is a top secret message!
โน Processing image...
โ Message hidden successfully!
โน Encryption key (save this!): 5e365d1e972297e6f6b028a6720385a1ccf126463a111537687aa1713024c4c6
Extract a Hidden Message
./stego extract
๐ Example Session
โ Enter image path:
sample-hidden.png
โ Enter encryption key (hex):
5e365d1e972297e6f6b028a6720385a1ccf126463a111537687aa1713024c4c6
โน Extracting message...
โ Message extracted successfully!
Extracted message: This is a top secret message!
The diagram below shows how Steg-Go transforms your secret message and embeds it invisibly into an image:
---
config:
layout: elk
---
flowchart TD
subgraph Input["Input Phase"]
C["Image Processing"]
A["Original Image"]
D["Message Processing"]
B["Secret Message"]
end
subgraph Encryption["Encryption Phase"]
E["Generate AES-256 Key"]
F["Encrypt Message"]
G["Encrypted Payload"]
end
subgraph Steganography["Steganography Phase"]
H["Extract Pixel Data"]
I["Convert to Bit Stream"]
J["LSB Replacement Algorithm"]
K["Modified Pixel Data"]
L["Assemble New Image"]
end
subgraph Output["Output Phase"]
M["Save as PNG"]
N["Display Encryption Key"]
end
subgraph LSB["LSB Modification Detail"]
LSB2["RGB Components"]
LSB1["Original Pixel Value"]
LSB3["LSB Replacement"]
LSB4["Secret Bit Stream"]
LSB5["New Pixel Value"]
end
A -- Load --> C
B -- Prepare --> D
D --> E
E --> F & N
F --> G
C --> H
G --> I
H --> J
I --> J
J --> K
K --> L
L --> M
LSB1 -- Extract --> LSB2
LSB2 -- Modify Last Bit --> LSB3
LSB4 --> LSB3
LSB3 --> LSB5
J -.-> LSB
A:::data
C:::process
B:::data
D:::process
E:::process
F:::process
G:::data
H:::process
I:::process
J:::process
K:::data
L:::process
M:::process
N:::data
LSB1:::detail
LSB2:::detail
LSB3:::detail
LSB4:::detail
LSB5:::detail
classDef phase fill:#ffe6cc,stroke:#d79b00,stroke-width:2px,color:#000000
classDef process fill:#e1f5fe,stroke:#01579b,stroke-width:2px,color:#000000
classDef data fill:#f3e5f5,stroke:#4a148c,stroke-width:2px,color:#000000
classDef detail fill:#fff3e0,stroke:#e65100,stroke-width:2px,color:#000000
- Input Phase: The original image and secret message are loaded and prepared
- Encryption Phase: Your message is secured with AES-256 encryption
- Steganography Phase: The encrypted data is embedded bit by bit into the image
- Output Phase: The modified image is saved, looking identical to the original
The LSB (Least Significant Bit) modification detail shows exactly how each pixel is subtly altered to store your secret data without visible changes.
Steg-Go hides your data by modifying the least significant bit of each color channel in image pixels:
Original Pixel | Secret Bits | Modified Pixel |
---|---|---|
R: 100 (01100100) G: 150 (10010110) B: 200 (11001000) |
1 1 1 |
R: 101 (01100101) G: 151 (10010111) B: 201 (11001001) |
---
config:
look: handDrawn
theme: default
---
graph LR
A[Original Message] -->|Random Key Generation| B[AES-256 Encryption]
B --> C[Encrypted Data]
C -->|Embedding| D[Modified Image]
E[Original Image] -->|Pixel Modification| D
classDiagram
class Main {
+main()
}
class Steganography {
+HideData()
+ExtractData()
}
class Crypto {
+Encrypt()
+Decrypt()
-GenerateKey()
}
class ImageProcessor {
+LoadImage()
+SaveImage()
+ModifyPixels()
}
class UI {
+PrintBanner()
+GetUserInput()
+DisplayResult()
}
Main --> UI
Main --> Steganography
Steganography --> Crypto
Steganography --> ImageProcessor
Component | Purpose |
---|---|
cmd/stego |
Entry point and command handling |
internal/steganography |
Core steganography algorithms |
internal/crypto |
Encryption and decryption logic |
pkg/imageprocessing |
Image manipulation utilities |
internal/ui |
User interface and interaction |
Visual Security | Cryptographic Security | Format Security |
Changes to the image are imperceptible to human eyes and basic analysis tools | Even if steganography is detected, the AES-256 encryption makes content unreadable without the key | Output as PNG preserves all data bits, preventing compression losses that occur with JPEG |
Contributions make the open-source community amazing! Any contributions you make are greatly appreciated.
gitGraph:
commit id: "Initial"
branch feature
checkout feature
commit id: "Feature"
commit id: "Tests"
checkout main
merge feature
commit id: "Release"
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
- Go Programming Language
- All the amazing contributors
- You, for checking out this project!
Created with โค๏ธ by pranaykumar2, Vinai2003, SGN/2100030721