# ChromaShift 🔐
A steganography tool that uses histogram shifting techniques to hide encrypted text messages within PNG images. ChromaShift combines AES encryption with histogram-based data embedding for secure covert communication.
## 🌟 Features
- **Histogram Shifting Steganography**: Utilizes peak and zero point detection in image histograms for data embedding
- **AES Encryption**: Messages are encrypted using AES-256 in EAX mode before embedding
- **Multi-channel Distribution**: Distributes encrypted data across RGB channels
- **Key-based Security**: Uses cryptographic keys for both encryption and randomized pixel selection
- **Format Validation**: Ensures only valid PNG images are processed
- **Capacity Analysis**: Automatically calculates and reports embedding capacity
- **CLI Interface**: Simple command-line interface for embedding and extraction
## 🛠️ Quick Start
### Prerequisites
```bash
pip install Pillow numpy pycryptodome
```
### Installation
```bash
pip install chromashift
```
### One-Line Installation
```bash
# System-wide (with sudo)
curl -sSL https://raw.githubusercontent.com/kaizoku73/ChromaShift/main/install.sh | sudo bash
# User installation (no sudo)
curl -sSL https://raw.githubusercontent.com/kaizoku73/ChromaShift/main/install.sh | bash
```
### Uninstallation
```bash
# To uninstall ChromaShift system-wide (with sudo):
curl -sSL https://raw.githubusercontent.com/kaizoku73/ChromaShift/main/uninstall.sh | sudo bash
# To uninstall ChromaShift (no sudo):
curl -sSL https://raw.githubusercontent.com/kaizoku73/ChromaShift/main/uninstall.sh | bash
```
### Clone Repository
```bash
git clone https://github.com/kaizoku73/ChromaShift.git
cd ChromaShift
```
## 🚀 Usage
### Embedding a Message
Hide a secret message in an image:
```bash
chromashift embed --in "Your secret message here" --cover image.png --key mypassword123
```
**Parameters:**
- `--in`: The text message to hide (max 100 characters)
- `--cover`: Path to the cover PNG image
- `--key`: Password for encryption and randomization
**Output:** Creates `encoded.png` with your hidden message
### Extracting a Message
Retrieve the hidden message from a steganographic image:
```bash
chromashift extract --stego encoded.png --key mypassword123
```
**Parameters:**
- `--stego`: Path to the image containing hidden data
- `--key`: The same password used during embedding
## 🔬 How It Works
### Histogram Shifting Algorithm
1. **Peak Detection**: Finds the peak (most frequent) pixel value in each RGB channel
2. **Zero Point Detection**: Identifies empty histogram bins near the peak
3. **Pixel Shifting**: Shifts pixel values between peak and zero to create embedding space
4. **Data Distribution**: Distributes encrypted payload bits across RGB channels
5. **Randomized Embedding**: Uses key-derived seeds for secure, random pixel selection
### Security Features
- **AES-256 Encryption**: Messages encrypted with AES-EAX mode before embedding
- **SHA-256 Key Derivation**: Secure key generation from passwords
- **Start/End Markers**: `HISTOSTART` and `HISTO_END!` markers for data validation
- **Randomized Selection**: Cryptographically secure pixel position randomization
## What is Histogram shift and how does it work?
For a detailed explanation of Histogram shift steganography and how it works, check out this article: https://kaizoku.gitbook.io/steganography/histogram-shift-in-image
## 🎯 Technical Specifications
- **Image Format**: PNG only (automatically validates format)
- **Color Mode**: RGB (auto-converts from other modes)
- **Message Limit**: 100 characters (padded to 100 bytes)
- **Encryption**: AES-256-EAX with nonce and authentication tag
- **Key Derivation**: SHA-256 hash of password
## 🔍 Algorithm Details
### Peak Finding Function
- Finds maximum frequency value (peak) in histogram
- Locates nearest zero-frequency bin for shifting
- Calculates embedding capacity based on peak frequency
### Bit Distribution
- Total bits distributed across 3 RGB channels
- Remainder bits allocated to first channels if not evenly divisible
- Each channel processes its allocated bit sequence
### Pixel Modification
- Peak pixels (value = u) remain unchanged for '0' bits
- Peak pixels shifted by ±1 (u + shift) for '1' bits
- Non-peak pixels shifted away to maintain histogram integrity
## ⚠️ Limitations
- Only supports PNG images (validates format before processing)
- Maximum message length: 100 characters
- Requires sufficient histogram peaks for embedding capacity
- Both embedding and extraction require identical keys
- Basic console output (no rich formatting implemented)
## 🔒 Security Considerations
- Uses AES-256-EAX providing both encryption and authentication
- Key-derived randomization prevents pattern detection
- Start/end markers ensure data integrity
- Password-based key derivation with SHA-256
## 🤝 Contributing
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/new-feature`)
3. Commit your changes (`git commit -m 'Add new feature'`)
4. Push to the branch (`git push origin feature/new-feature`)
5. Open a Pull Request
## 📝 License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## 🔧 Error Handling
The tool includes comprehensive error handling for:
- Missing or invalid image files
- Non-PNG format images
- Empty or oversized messages
- Insufficient embedding capacity
- Wrong extraction keys
- Corrupted steganographic data
---
## Disclaimer
This tool is for educational and legitimate purposes only. Users are responsible for ensuring compliance with applicable laws and regulations when using steganography techniques.
---
**Made by kaizoku**
Raw data
{
"_id": null,
"home_page": null,
"name": "chromashift",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "kaizoku73 <ultimate0134@gmail.com>",
"keywords": "steganography, audio, phase-coding, cryptography, security, wav, phase-manipulation",
"author": null,
"author_email": "kaizoku73 <ultimate0134@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/3e/1c/74501f3748838530301c3f49b22133dbe49e00142e97b0dab8ce773e9d08/chromashift-1.0.2.tar.gz",
"platform": null,
"description": "# ChromaShift \ud83d\udd10\n\nA steganography tool that uses histogram shifting techniques to hide encrypted text messages within PNG images. ChromaShift combines AES encryption with histogram-based data embedding for secure covert communication.\n\n## \ud83c\udf1f Features\n\n- **Histogram Shifting Steganography**: Utilizes peak and zero point detection in image histograms for data embedding\n- **AES Encryption**: Messages are encrypted using AES-256 in EAX mode before embedding\n- **Multi-channel Distribution**: Distributes encrypted data across RGB channels\n- **Key-based Security**: Uses cryptographic keys for both encryption and randomized pixel selection\n- **Format Validation**: Ensures only valid PNG images are processed\n- **Capacity Analysis**: Automatically calculates and reports embedding capacity\n- **CLI Interface**: Simple command-line interface for embedding and extraction\n\n## \ud83d\udee0\ufe0f Quick Start\n\n### Prerequisites\n\n```bash\npip install Pillow numpy pycryptodome\n```\n\n### Installation\n\n```bash\npip install chromashift\n```\n\n### One-Line Installation\n\n```bash\n# System-wide (with sudo)\ncurl -sSL https://raw.githubusercontent.com/kaizoku73/ChromaShift/main/install.sh | sudo bash\n\n# User installation (no sudo)\ncurl -sSL https://raw.githubusercontent.com/kaizoku73/ChromaShift/main/install.sh | bash\n```\n### Uninstallation\n\n```bash\n# To uninstall ChromaShift system-wide (with sudo):\ncurl -sSL https://raw.githubusercontent.com/kaizoku73/ChromaShift/main/uninstall.sh | sudo bash\n\n# To uninstall ChromaShift (no sudo):\ncurl -sSL https://raw.githubusercontent.com/kaizoku73/ChromaShift/main/uninstall.sh | bash\n\n```\n\n### Clone Repository\n\n```bash\ngit clone https://github.com/kaizoku73/ChromaShift.git\ncd ChromaShift\n```\n\n## \ud83d\ude80 Usage\n\n### Embedding a Message\n\nHide a secret message in an image:\n\n```bash\nchromashift embed --in \"Your secret message here\" --cover image.png --key mypassword123\n```\n\n**Parameters:**\n- `--in`: The text message to hide (max 100 characters)\n- `--cover`: Path to the cover PNG image\n- `--key`: Password for encryption and randomization\n\n**Output:** Creates `encoded.png` with your hidden message\n\n### Extracting a Message\n\nRetrieve the hidden message from a steganographic image:\n\n```bash\nchromashift extract --stego encoded.png --key mypassword123\n```\n\n**Parameters:**\n- `--stego`: Path to the image containing hidden data\n- `--key`: The same password used during embedding\n\n## \ud83d\udd2c How It Works\n\n### Histogram Shifting Algorithm\n\n1. **Peak Detection**: Finds the peak (most frequent) pixel value in each RGB channel\n2. **Zero Point Detection**: Identifies empty histogram bins near the peak\n3. **Pixel Shifting**: Shifts pixel values between peak and zero to create embedding space\n4. **Data Distribution**: Distributes encrypted payload bits across RGB channels\n5. **Randomized Embedding**: Uses key-derived seeds for secure, random pixel selection\n\n### Security Features\n\n- **AES-256 Encryption**: Messages encrypted with AES-EAX mode before embedding\n- **SHA-256 Key Derivation**: Secure key generation from passwords\n- **Start/End Markers**: `HISTOSTART` and `HISTO_END!` markers for data validation\n- **Randomized Selection**: Cryptographically secure pixel position randomization\n\n## What is Histogram shift and how does it work?\nFor a detailed explanation of Histogram shift steganography and how it works, check out this article: https://kaizoku.gitbook.io/steganography/histogram-shift-in-image\n\n## \ud83c\udfaf Technical Specifications\n\n- **Image Format**: PNG only (automatically validates format)\n- **Color Mode**: RGB (auto-converts from other modes)\n- **Message Limit**: 100 characters (padded to 100 bytes)\n- **Encryption**: AES-256-EAX with nonce and authentication tag\n- **Key Derivation**: SHA-256 hash of password\n\n\n## \ud83d\udd0d Algorithm Details\n\n### Peak Finding Function\n- Finds maximum frequency value (peak) in histogram\n- Locates nearest zero-frequency bin for shifting\n- Calculates embedding capacity based on peak frequency\n\n### Bit Distribution\n- Total bits distributed across 3 RGB channels\n- Remainder bits allocated to first channels if not evenly divisible\n- Each channel processes its allocated bit sequence\n\n### Pixel Modification\n- Peak pixels (value = u) remain unchanged for '0' bits\n- Peak pixels shifted by \u00b11 (u + shift) for '1' bits\n- Non-peak pixels shifted away to maintain histogram integrity\n\n## \u26a0\ufe0f Limitations\n\n- Only supports PNG images (validates format before processing)\n- Maximum message length: 100 characters\n- Requires sufficient histogram peaks for embedding capacity\n- Both embedding and extraction require identical keys\n- Basic console output (no rich formatting implemented)\n\n## \ud83d\udd12 Security Considerations\n\n- Uses AES-256-EAX providing both encryption and authentication\n- Key-derived randomization prevents pattern detection\n- Start/end markers ensure data integrity\n- Password-based key derivation with SHA-256\n\n## \ud83e\udd1d Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/new-feature`)\n3. Commit your changes (`git commit -m 'Add new feature'`)\n4. Push to the branch (`git push origin feature/new-feature`)\n5. Open a Pull Request\n\n## \ud83d\udcdd License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \ud83d\udd27 Error Handling\n\nThe tool includes comprehensive error handling for:\n- Missing or invalid image files\n- Non-PNG format images\n- Empty or oversized messages\n- Insufficient embedding capacity\n- Wrong extraction keys\n- Corrupted steganographic data\n\n---\n\n## Disclaimer\n\nThis tool is for educational and legitimate purposes only. Users are responsible for ensuring compliance with applicable laws and regulations when using steganography techniques.\n\n---\n\n**Made by kaizoku**\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Audio steganography tool using phase coding",
"version": "1.0.2",
"project_urls": {
"Bug Reports": "https://github.com/kaizoku73/Chromashift/issues",
"Documentation": "https://kaizoku.gitbook.io/steganography/histogram-shift-in-image",
"Homepage": "https://github.com/kaizoku73/Chromashift",
"Repository": "https://github.com/kaizoku73/Chromashift"
},
"split_keywords": [
"steganography",
" audio",
" phase-coding",
" cryptography",
" security",
" wav",
" phase-manipulation"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "8721ad69731dcf5293e7e38746a6764e1abf23f0f4c671cc6d528801bff49244",
"md5": "01c9cd038c68d0c9db94f87aafa46eb7",
"sha256": "847a6164e803c52cd100aecefccf3d357f57349bfb0a1a89e892eb73997a60e7"
},
"downloads": -1,
"filename": "chromashift-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "01c9cd038c68d0c9db94f87aafa46eb7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 9528,
"upload_time": "2025-09-11T16:30:48",
"upload_time_iso_8601": "2025-09-11T16:30:48.423610Z",
"url": "https://files.pythonhosted.org/packages/87/21/ad69731dcf5293e7e38746a6764e1abf23f0f4c671cc6d528801bff49244/chromashift-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "3e1c74501f3748838530301c3f49b22133dbe49e00142e97b0dab8ce773e9d08",
"md5": "da5ed619d002e95ee1aa0de4419b6c9e",
"sha256": "e03dba305d8fc11cc9a3311692dfb67fd2f37b719225b4d619cc0fb28bc7a2c0"
},
"downloads": -1,
"filename": "chromashift-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "da5ed619d002e95ee1aa0de4419b6c9e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 8232,
"upload_time": "2025-09-11T16:30:49",
"upload_time_iso_8601": "2025-09-11T16:30:49.585699Z",
"url": "https://files.pythonhosted.org/packages/3e/1c/74501f3748838530301c3f49b22133dbe49e00142e97b0dab8ce773e9d08/chromashift-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-11 16:30:49",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kaizoku73",
"github_project": "Chromashift",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "numpy",
"specs": [
[
"==",
"2.3.2"
]
]
},
{
"name": "pillow",
"specs": [
[
"==",
"11.3.0"
]
]
},
{
"name": "pycryptodome",
"specs": [
[
"==",
"3.23.0"
]
]
}
],
"lcname": "chromashift"
}