Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liorp/pysteg
https://github.com/liorp/pysteg
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/liorp/pysteg
- Owner: liorp
- Created: 2021-08-13T17:45:43.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-04T21:57:24.000Z (almost 3 years ago)
- Last Synced: 2024-09-28T09:26:26.847Z (3 months ago)
- Language: Python
- Size: 49.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![PyPI version](https://badge.fury.io/py/pysteg.svg)](https://badge.fury.io/py/pysteg)
![PyPI - Downloads](https://img.shields.io/pypi/dm/pysteg)# `pysteg`
`pysteg` is a python library for image steganography.From Wikipedia:
> Steganography is the practice of concealing a message within another message or a physical object.
In computing/electronic contexts, a computer file, message, image, or video is concealed within another file, message, image, or video.
The word steganography comes from Greek steganographia, which combines the words steganós (στεγανός), meaning "covered or concealed", and -graphia (γραφή) meaning "writing".# Usage
```python
import imageio
from cryptography.fernet import Fernetfrom encrypt import Encryptor
from decrypt import Decryptordef load_image(path: str):
return imageio.imread(path)def load_password(password: str) -> Fernet:
return Fernet(password.encode())def main():
in_path = "./dogcyber.png"
out_path = "./dogscybersteg.png"
password = "12345678"
message = "My secret message!"im = load_image(in_path)
encryptor = Encryptor(password)
encryptor.encrypt(im, message, out_path)decryptor = Decryptor(password)
print(decryptor.decrypt(load_image(out_path)))if __name__ == '__main__':
main()
```# Dependencies
`cryptography` and `imageio`
Built with `poetry`# License
MIT