Version 1.1.0
Built on the CryptoShade reversible algorithm
pyshade is a minimalist yet powerful encryption library for Python, designed to obfuscate and restore text effortlessly using a unique, per-run character map. With zero dependencies and pure Python (3.8+), it integrates seamlessly into any project.
✅ Reversible symmetric cipher – Decrypt exactly what you encrypted.
✅ Full ASCII support – Works with all standard characters.
✅ Randomized per-run keys – Fresh numeric mapping for every encryption.
✅ Blazing fast – O(n) complexity, ideal for any payload size.
✅ Zero dependencies – Pure Python, no external libraries.
✅ JSON key export/import – Securely store or transmit keys.
pip install pyshadefrom pyshade.interface import PyshadeNote
Currently supports strings only (lists/dicts coming soon!).
- This is for encrypting string
encrypted_data = Pyshade.encrypt("hello world")
Returns a dict with:
data: Obfuscated string (e.g.,"364/830/978/978/377/...")key: One-time numeric mapping (dict type) (e.g.,{"a": 253, "b": 721, ...})
- This is for encrypting list and dictionary
encrypted_data = Pyshade.encrypt_struct(["apple", "orange", "banana"])
Returns a dict with:
data: Obfuscated string (e.g.,"364/830/978/978/377/...")key: One-time numeric mapping (dict type) (e.g.,{"a": 253, "b": 721, ...})
- This is for string decryption
decrypted = Pyshade.decrypt(encrypted_data["data"], encrypted_data["key"]) print(decrypted) # output: "hello world"
- This is for dict or list decryption
decrypted = Pyshade.decrypt_struct(encrypted_data["data"], encrypted_data["key"]) print(decrypted) # output: { "username": "john_doe1234", "password": "123456789" }
⚠️ WARNING
The key is one-time use only. Lose it, and decryption is impossible!
- This is for encrypting string
encrypted_data = Pyshade.encrypt_jsonkey("hello world")
Returns a dict with:
data: Obfuscated string (e.g.,"364/830/978/978/377/...")key: JSON string of One-time numeric mapping (e.g.,"{"a": 253, "b": 721, ...}")
- This is for encrypting list and dictionary
encrypted_data = Pyshade.encrypt_struct_jsonkey(["apple", "orange", "banana"])
Returns a dict with:
data: Obfuscated string (e.g.,"364/830/978/978/377/...")key: JSON string of One-time numeric mapping (e.g.,"{"a": 253, "b": 721, ...}")
- This is for string decryption
decrypted = Pyshade.decrypt_jsonkey(encrypted_data["data"], encrypted_data["key"]) print(decrypted) # output: "hello world"
- This is for dict or list decryption
decrypted = Pyshade.decrypt_struct_jsonkey(encrypted_data["data"], encrypted_data["key"]) print(decrypted) # output: { "username": "john_doe1234", "password": "123456789" }
⚠️ WARNING
The key is one-time use only. Lose it, and decryption is impossible!
- Never reuse keys: Each
encrypt_method()call generates a unique cipher. - Use JSON keys for transmission: Safer for APIs/networked data.
- Static methods: No need to instantiate
Pyshade—just call the methods directly!
We welcome contributions! Here’s how to help:
-
Fork the repository and clone it locally.
-
Create a branch for your feature/fix:
git checkout -b feature/your-feature-name
- Report bugs via GitHub Issues.
- Suggest features by opening a discussion.
- Submit PRs for:
- Bug fixes (with tests).
- New features (documented and tested).
- Documentation improvements.
Ensure all tests pass before submitting:
pytest tests/MIT – Free for any use.