![](https://private-user-images.githubusercontent.com/94792103/348485321-65d8da5a-3af5-45a8-b409-09dfd9205bbd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NTYwNTEsIm5iZiI6MTczODk1NTc1MSwicGF0aCI6Ii85NDc5MjEwMy8zNDg0ODUzMjEtNjVkOGRhNWEtM2FmNS00NWE4LWI0MDktMDlkZmQ5MjA1YmJkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA3VDE5MTU1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJjNjVlZTBkNGMyZjM0NTk2MDI2YmViMDYzOTUzMmU5MmJhYWZmYzYyOTAwZGQ5YmQyMDkyNGI4MWYwYzExMmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.QvNF1VcmyJW3pzMuQDXSEfPFF-cJ-BgnHaYb39VgUoY)
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.