Note: deploy and update script are for automate deployment.However, this might not work on some server. So we can deploy it manually throught this README
A modern web-based steganography tool that allows you to hide secret messages inside images using LSB (Least Significant Bit) encoding. Built with HTML, CSS, JavaScript frontend and Go backend.
- Encode Messages: Hide secret text messages inside PNG images
- Decode Messages: Extract hidden messages from encoded images
- LSB Steganography: Uses Least Significant Bit technique for invisible message embedding
- Password Protection: Optional AES-256-GCM encryption with SHA-256 hashed passwords
- Real-time Preview: See your images before encoding/decoding
- Download Encoded Images: Save your steganographic images locally
- Copy to Clipboard: Easily copy decoded messages
- Fast Processing: Efficient Go backend handles images quickly
- Responsive Design: Mobile-first design works on all devices
- Minimal Dependencies: No external libraries required, reducing overhead
- Concurrent Handling: Go's goroutines enable multiple simultaneous requests
- Optimized Frontend: Vanilla JavaScript for fast load times
- AES-256-GCM Encryption: Military-grade encryption for message protection
- SHA-256 Password Hashing: Secure key derivation from passwords
- CORS Protection: Configurable cross-origin resource sharing
- No Data Storage: Messages are never stored on the server
- Client-Side Validation: Input validation before API calls
- HTTPS Ready: Designed for secure SSL/TLS deployment
- HTML5
- CSS
- JavaScript
- Go (Golang)
- Standard library
- PNG image processing
Stegano/
├── backend/
│ ├── main.go # Application entry point
│ ├── go.mod # Go module file
│ ├── handlers/
│ │ ├── api.go # API handlers (encode/decode)
│ │ └── static.go # Static file serving
│ └── utils/
│ ├── crypto.go # AES encryption/decryption
│ └── steganography.go # LSB steganography logic
├── frontend/
│ ├── index.html # Main HTML file
│ ├── style.css # Styling
│ └── script.js # Frontend logic
├── deploy.sh # Automated deployment script
├── update.sh # Quick update script
├── DEPLOYMENT.md # Deployment guide
└── README.md # Project documentation
- Click on the Encode tab
- Select an image file (PNG recommended for lossless encoding)
- Enter your secret message in the text area
- Click Encode Message
- Download the encoded image once processing is complete
- Click on the Decode tab
- Select an encoded image (previously created with this tool)
- Click Decode Message
- The hidden message will be displayed
- Click Copy to Clipboard to copy the message
The tool combines Least Significant Bit (LSB) steganography with AES encryption:
-
Encoding:
- (Optional) Encrypts the message using AES-GCM with SHA-256 hashed password
- Converts the (encrypted) message to binary
- Replaces the least significant bits of RGB pixel values with message bits
- Creates a new image that looks identical to the original
- Stores message length as a header for accurate extraction
-
Decoding:
- Reads the LSB of each pixel's RGB values
- Extracts the message length from the header
- Reconstructs the original (encrypted) message from the bits
- (Optional) Decrypts the message using the provided password
- Algorithm: AES-256-GCM (Galois/Counter Mode)
- Key Derivation: SHA-256 hash of password
- Authentication: GCM provides both encryption and authentication
- Nonce: Randomly generated for each encryption
- Description: Encode a message into an image
- Parameters:
image(file): The carrier imagemessage(string): The secret message to hidepassword(string, optional): Password for encryption
- Response: PNG image file with encoded message
- Description: Extract a hidden message from an image
- Parameters:
image(file): The encoded imagepassword(string, optional): Password for decryption (if encrypted)
- Response: JSON object with the decoded message
- Use PNG images for best results (JPG compression may destroy hidden data)
- The image must be large enough to hold your message
- Encoded images look identical to originals to the human eye
- Only images encoded with this tool can be decoded by it
- LSB steganography is detectable with steganalysis tools
- Password protection adds encryption layer (AES-256-GCM)
- Password is hashed with SHA-256 before use as encryption key
- Without password, messages are hidden but not encrypted
- Always use strong passwords for sensitive data
- The same password must be used for both encoding and decoding
- Ubuntu/Debian server (tested on Ubuntu 22.04)
- Domain name pointed to your server
- Root or sudo access
# Update system packages
sudo apt update
# Install Go
sudo apt install go-lang -y
# Verify Go installation
go version# Create application directory
sudo mkdir -p /var/www/stegano
cd /var/www/stegano
# Clone or copy your project files
# Upload your Stegano folder to /var/www/stegano
# Build the Go application
cd /var/www/stegano/backend
go build -o stegano main.goCreate a service file to run your application as a daemon:
sudo nano /etc/systemd/system/stegano.serviceAdd the following content:
[Unit]
Description=Steganography Tool Service
After=network.target
[Service]
Type=simple
User=www-data
WorkingDirectory=/var/www/stegano/backend
ExecStart=/var/www/stegano/backend/stegano
Restart=always
RestartSec=5
Environment=PORT=8080
[Install]
WantedBy=multi-user.targetEnable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable stegano
sudo systemctl start stegano
sudo systemctl status stegano# Install Nginx
sudo apt install nginx -y
# Create Nginx configuration
sudo nano /etc/nginx/sites-available/steganoAdd the following configuration:
server {
listen 80;
server_name stegano.shvpn.live;
# Increase max upload size for images
client_max_body_size 20M;
# Serve frontend files
location / {
root /var/www/stegano/frontend;
try_files $uri $uri/ /index.html;
}
# Proxy API requests to Go backend
location /api/ {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}Enable the site:
# Create symbolic link
sudo ln -s /etc/nginx/sites-available/stegano /etc/nginx/sites-enabled/
# Test Nginx configuration
sudo nginx -t
# Restart Nginx
sudo systemctl restart nginxPoint your domain to your server:
- Go to your DNS provider (e.g., Cloudflare, GoDaddy, Namecheap)
- Add an A Record:
- Type: A
- Name: stegano (or @ for root domain)
- Value: {YourIP}
- TTL: Automatic or 300
Wait for DNS propagation (usually 5-15 minutes).
# Install Certbot
sudo apt install certbot python3-certbot-nginx -y
# Obtain SSL certificate
sudo certbot --nginx -d stegano.shvpn.live
# Follow the prompts:
# - Enter your email address
# - Agree to terms of service
# - Choose whether to redirect HTTP to HTTPS (recommended: Yes)Certbot will automatically:
- Obtain the SSL certificate
- Configure Nginx to use HTTPS
- Set up auto-renewal
Test auto-renewal:
sudo certbot renew --dry-run# Allow Nginx through firewall
sudo ufw allow 'Nginx Full'
sudo ufw allow OpenSSH
sudo ufw enable
sudo ufw statusUpdate the CORS settings in backend/main.go for production:
func enableCORS(w http.ResponseWriter) {
w.Header().Set("Access-Control-Allow-Origin", "https://stegano.shvpn.live")
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS")
w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
}Rebuild and restart:
cd /var/www/stegano/backend
go build -o stegano main.go
sudo systemctl restart steganoVisit https://stegano.shvpn.live in your browser. You should see:
- ✅ Secure HTTPS connection (padlock icon)
- ✅ Your steganography tool interface
- ✅ Ability to encode/decode images
# View application logs
sudo journalctl -u stegano -f
# Check Nginx logs
sudo tail -f /var/log/nginx/access.log
sudo tail -f /var/log/nginx/error.log
# Restart services if needed
sudo systemctl restart stegano
sudo systemctl restart nginx
# Check SSL certificate expiration
sudo certbot certificatesAdd caching headers in Nginx:
# Add inside server block
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
root /var/www/stegano/frontend;
expires 1y;
add_header Cache-Control "public, immutable";
}Enable Gzip compression:
# Add inside server block
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
gzip_min_length 1000;Service won't start:
sudo journalctl -u stegano -n 50Nginx errors:
sudo nginx -t
sudo tail -f /var/log/nginx/error.logSSL certificate issues:
sudo certbot certificates
sudo certbot renew --force-renewalPort already in use:
sudo lsof -i :8080
sudo kill -9 <PID>This project is open source and available for educational purposes.
Feel free to fork, modify, and submit pull requests!
Lect.Mr. Meas Sothearath AI