Skip to content

pranaykumar2/steg-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Steg-Go Logo

Secret Text Embedded Generates Output

Go Version License Stars Run on Replit


🌟 What is Steg-Go?

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.

"If you want to keep a secret, you must also hide it from yourself." — George Orwell


✨ Key Features

Military-Grade Encryption Intuitive CLI Transparent Visual Quality
AES-256 encryption ensures your data remains secure even if steganography is detected Simple, guided interface for both hiding and extracting data No visible changes to images — your secrets remain truly hidden

Security & Stealth

  • 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

🚀 Installation

📦 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
  1. Install Go from golang.org/dl

  2. Clone the repository

    git clone https://github.com/pranaykumar2/steg-go.git cd steg-go
  3. Build the application

    go mod tidy go build -o stego.exe ./cmd/stego
  4. 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

☁️ Try Online

No installation required! Try Steg-Go instantly:

Run on Replit


🎮 How to Use

Terminal Demo

Hide a Secret Message

./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 Magic Behind Steg-Go

Complete Data Flow Process

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 
Loading

How It Works

  1. Input Phase: The original image and secret message are loaded and prepared
  2. Encryption Phase: Your message is secured with AES-256 encryption
  3. Steganography Phase: The encrypted data is embedded bit by bit into the image
  4. 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.

LSB Steganography Explained

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)

AES-256 Encryption Flow

--- 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 
Loading

👀 See the Difference (or Not!)

Original Image Image with Secret

Can you spot the difference? Nobody can—that's the point!


🧠 Technical Architecture

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 
Loading
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

🛡️ Security Considerations

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

🤝 Contributing

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" 
Loading
  1. Fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

Distributed under the MIT License. See LICENSE for more information.

🙏 Acknowledgements

  • Go Programming Language
  • All the amazing contributors
  • You, for checking out this project!

Created with ❤️ by pranaykumar2, Vinai2003, SGN/2100030721


GitHub followers LinkedIn Go Reference

About

Go based Image Steganography Tool.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •