https://github.com/samadpls/imagecipher
ImageCipher is a Python library for encoding and decoding messages in images using steganography and optional encryption
https://github.com/samadpls/imagecipher
cryptography encryption-library opensource pil python-library steganography-library
Last synced: 3 months ago
JSON representation
ImageCipher is a Python library for encoding and decoding messages in images using steganography and optional encryption
- Host: GitHub
- URL: https://github.com/samadpls/imagecipher
- Owner: samadpls
- License: mit
- Created: 2024-07-12T20:42:48.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-06T19:01:01.000Z (11 months ago)
- Last Synced: 2025-05-25T05:53:52.213Z (5 months ago)
- Topics: cryptography, encryption-library, opensource, pil, python-library, steganography-library
- Language: Python
- Homepage: https://huggingface.co/spaces/samadpls/ImageCipher
- Size: 2.87 MB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Image Cipher
ImageCipher is a Python library for encoding and decoding messages in images using steganography and optional encryption.

[](https://www.python.org/dev/peps/pep-0008/)
[](LICENSE)
[](https://github.com/samadpls/ImageCipher/actions/workflows/pytest.yml)![]()
## Installation 🚀You can install ImageCipher using pip:
```
pip install imagecipher
```## Features ✨
- Encode text messages into images
- Decode messages from encoded images
- Optional encryption of messages before encoding
- Support for various image formats## Usage 📝
Here's a quick example of how to use ImageCipher:
```python
from image_cipher import ImageCipher# Create an instance of ImageCipher
cipher = ImageCipher()# Encode a message
encoded_image_path = cipher.encode("original_image.png", "Secret message", encrypt=True)# Decode a message
decoded_message = cipher.decode(encoded_image_path, key=cipher.key)print(decoded_message) # Output: Secret message
```## API Reference 📘
### `ImageCipher` class
#### `encode(image_path, message, encrypt=True)`
Encodes a message into an image.
- `image_path` (str): The path to the input image file.
- `message` (str): The message to be encoded.
- `encrypt` (bool, optional): Whether to encrypt the message. Defaults to True.Returns:
- str: The path to the output encoded image file.#### `decode(image_path, key=None)`
Decodes a message from an encoded image.
- `image_path` (str): The path to the input encoded image file.
- `key` (str, optional): The encryption key for decryption. Required if the message was encrypted.Returns:
- str: The decoded message.## Requirements 🛠️
- Python 3.6+
- Pillow (PIL)
- cryptography## Contributing 🙌
Contributions are welcome! Please feel free to submit a Pull Request.