ImageCipher is a Python library for encoding and decoding messages in images using steganography and optional encryption.
You can install ImageCipher using pip:
pip install imagecipher
- Encode text messages into images
- Decode messages from encoded images
- Optional encryption of messages before encoding
- Support for various image formats
Here's a quick example of how to use ImageCipher:
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
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.
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.
- Python 3.6+
- Pillow (PIL)
- cryptography
Contributions are welcome! Please feel free to submit a Pull Request.