# CLWE - Color Lattice Learning with Errors
**Ultra-optimized post-quantum cryptography with revolutionary visual steganography**
[](https://pypi.org/project/clwe/)
[](https://pypi.org/project/clwe/)
[](https://github.com/clwe-dev/clwe/blob/main/LICENSE)
CLWE v0.0.1 is a revolutionary post-quantum cryptographic library featuring unified automatic encryption with intelligent content detection. One method encrypts any content type - text, files, or binary data - into visual images while maintaining 99.9% compression efficiency and post-quantum security.
## Key Features
- **Unified Automatic API**: Single `encrypt_to_image()` method handles all content types automatically
- **Intelligent Content Detection**: Automatically detects text, file paths, and binary data
- **Universal File Support**: Encrypt any file type (documents, images, videos, executables, etc.)
- **Enhanced Variable Encryption**: Each encryption produces different output for same input (security boost)
- **Superior Compression**: 99.9% size reduction using 3-bytes-per-color packing
- **Metadata Preservation**: Maintains filename, size, and file type information
- **Pixel String Layout**: Perfect pixel strings with height=1 and exact width matching
- **Post-Quantum Security**: Resistant to both classical and quantum attacks
- **Visual Steganography**: Encrypt data into colorful visual patterns
- **Ultra-Optimized**: Sub-millisecond operations with intelligent compression selection
## Quick Start
### Installation
```bash
pip install clwe
```
### Basic Usage
```python
import clwe
# Key Encapsulation Mechanism
kem = clwe.ChromaCryptKEM(security_level=128)
public_key, private_key = kem.keygen()
shared_secret, ciphertext = kem.encapsulate(public_key)
recovered_secret = kem.decapsulate(private_key, ciphertext)
# Universal Automatic Encryption - Single Method for Everything
cipher = clwe.ColorCipher()
# Text encryption (automatic detection)
text_encrypted = cipher.encrypt_to_image("Hello World!", "password123")
decrypted_text = cipher.decrypt_from_image(text_encrypted, "password123")
# File encryption (automatic path detection)
file_encrypted = cipher.encrypt_to_image("document.pdf", "password123")
decrypted_file_path = cipher.decrypt_from_image(file_encrypted, "password123", "output/")
# Binary data encryption (automatic type detection)
binary_encrypted = cipher.encrypt_to_image(binary_data, "password123")
decrypted_binary = cipher.decrypt_from_image(binary_encrypted, "password123")
# Each encryption produces different output (security enhancement)
enc1 = cipher.encrypt_to_image("same_content", "password")
enc2 = cipher.encrypt_to_image("same_content", "password")
# enc1 != enc2 (different encrypted images for security)
# Quantum-Resistant Hashing
hasher = clwe.ColorHash()
color_hash = hasher.hash("data to hash")
# Digital Signatures
signer = clwe.ChromaCryptSign(security_level=128)
pub_key, priv_key = signer.keygen()
signature = signer.sign(priv_key, "message")
is_valid = signer.verify(pub_key, "message", signature)
```
## Security Levels
CLWE supports multiple security levels:
- **128-bit**: Fast operations, suitable for most applications
- **192-bit**: Enhanced security for sensitive data
- **256-bit**: Maximum security for critical applications
## Performance
CLWE v0.0.1 achieves industry-competitive performance:
- **Key Generation**: <10ms (128-bit security)
- **Encapsulation**: <5ms average
- **Decapsulation**: <3ms average
- **Visual Encryption**: <1ms for typical messages
- **Public Key Size**: 0.4KB (vs 4MB in basic implementations)
## Advanced Features
### Batch Processing
```python
from clwe.core.batch_operations import batch_color_processor
messages = ["msg1", "msg2", "msg3"]
passwords = ["pwd1", "pwd2", "pwd3"]
encrypted_batch = batch_color_processor.batch_color_encryption(messages, passwords)
```
### Hardware Acceleration
```python
from clwe.core.hardware_acceleration import hardware_manager
# Automatically uses available SIMD and multi-core capabilities
perf_summary = hardware_manager.get_performance_summary()
```
### Side-Channel Protection
```python
from clwe.core.side_channel_protection import side_channel_protection
# Validate security parameters
validation = side_channel_protection.validate_security_hardness(256, 3329, 2)
```
## Documentation
- [Usage Guide](USAGE_GUIDE.md) - Comprehensive usage examples
- [Publishing Guide](PUBLISHING_GUIDE.md) - How to contribute and publish
- [API Reference](docs/api.md) - Complete API documentation
- [Performance Analysis](docs/performance.md) - Detailed benchmarks
## Requirements
- Python 3.8+
- NumPy >= 1.19.0
- cryptography >= 3.0.0
- Pillow >= 8.0.0
## License
MIT License - see [LICENSE](LICENSE) for details.
## Contributing
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
## Citation
If you use CLWE in your research, please cite:
```bibtex
@software{clwe2025,
title={CLWE: Color Lattice Learning with Errors},
author={CLWE Development Team},
year={2025},
url={https://github.com/clwe-dev/clwe}
}
```
Raw data
{
"_id": null,
"home_page": "https://cryptopix.in",
"name": "clwe",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "post-quantum, cryptography, lattice, visual-steganography",
"author": "Siddhu Chelluru",
"author_email": "Siddhu Chelluru <founder@cryptopix.in>",
"download_url": "https://files.pythonhosted.org/packages/63/e5/541154d9b9f66b3703794e91330ec02563d4161ab19ec8ec6bac471a9978/clwe-0.0.0.tar.gz",
"platform": null,
"description": "# CLWE - Color Lattice Learning with Errors\r\n\r\n**Ultra-optimized post-quantum cryptography with revolutionary visual steganography**\r\n\r\n[](https://pypi.org/project/clwe/)\r\n[](https://pypi.org/project/clwe/)\r\n[](https://github.com/clwe-dev/clwe/blob/main/LICENSE)\r\n\r\nCLWE v0.0.1 is a revolutionary post-quantum cryptographic library featuring unified automatic encryption with intelligent content detection. One method encrypts any content type - text, files, or binary data - into visual images while maintaining 99.9% compression efficiency and post-quantum security.\r\n\r\n## Key Features\r\n\r\n- **Unified Automatic API**: Single `encrypt_to_image()` method handles all content types automatically\r\n- **Intelligent Content Detection**: Automatically detects text, file paths, and binary data\r\n- **Universal File Support**: Encrypt any file type (documents, images, videos, executables, etc.)\r\n- **Enhanced Variable Encryption**: Each encryption produces different output for same input (security boost)\r\n- **Superior Compression**: 99.9% size reduction using 3-bytes-per-color packing\r\n- **Metadata Preservation**: Maintains filename, size, and file type information\r\n- **Pixel String Layout**: Perfect pixel strings with height=1 and exact width matching\r\n- **Post-Quantum Security**: Resistant to both classical and quantum attacks\r\n- **Visual Steganography**: Encrypt data into colorful visual patterns\r\n- **Ultra-Optimized**: Sub-millisecond operations with intelligent compression selection\r\n\r\n## Quick Start\r\n\r\n### Installation\r\n\r\n```bash\r\npip install clwe\r\n```\r\n\r\n### Basic Usage\r\n\r\n```python\r\nimport clwe\r\n\r\n# Key Encapsulation Mechanism\r\nkem = clwe.ChromaCryptKEM(security_level=128)\r\npublic_key, private_key = kem.keygen()\r\nshared_secret, ciphertext = kem.encapsulate(public_key)\r\nrecovered_secret = kem.decapsulate(private_key, ciphertext)\r\n\r\n# Universal Automatic Encryption - Single Method for Everything\r\ncipher = clwe.ColorCipher()\r\n\r\n# Text encryption (automatic detection)\r\ntext_encrypted = cipher.encrypt_to_image(\"Hello World!\", \"password123\")\r\ndecrypted_text = cipher.decrypt_from_image(text_encrypted, \"password123\")\r\n\r\n# File encryption (automatic path detection)\r\nfile_encrypted = cipher.encrypt_to_image(\"document.pdf\", \"password123\")\r\ndecrypted_file_path = cipher.decrypt_from_image(file_encrypted, \"password123\", \"output/\")\r\n\r\n# Binary data encryption (automatic type detection)\r\nbinary_encrypted = cipher.encrypt_to_image(binary_data, \"password123\")\r\ndecrypted_binary = cipher.decrypt_from_image(binary_encrypted, \"password123\")\r\n\r\n# Each encryption produces different output (security enhancement)\r\nenc1 = cipher.encrypt_to_image(\"same_content\", \"password\")\r\nenc2 = cipher.encrypt_to_image(\"same_content\", \"password\")\r\n# enc1 != enc2 (different encrypted images for security)\r\n\r\n# Quantum-Resistant Hashing\r\nhasher = clwe.ColorHash()\r\ncolor_hash = hasher.hash(\"data to hash\")\r\n\r\n# Digital Signatures\r\nsigner = clwe.ChromaCryptSign(security_level=128)\r\npub_key, priv_key = signer.keygen()\r\nsignature = signer.sign(priv_key, \"message\")\r\nis_valid = signer.verify(pub_key, \"message\", signature)\r\n```\r\n\r\n## Security Levels\r\n\r\nCLWE supports multiple security levels:\r\n\r\n- **128-bit**: Fast operations, suitable for most applications\r\n- **192-bit**: Enhanced security for sensitive data\r\n- **256-bit**: Maximum security for critical applications\r\n\r\n## Performance\r\n\r\nCLWE v0.0.1 achieves industry-competitive performance:\r\n\r\n- **Key Generation**: <10ms (128-bit security)\r\n- **Encapsulation**: <5ms average\r\n- **Decapsulation**: <3ms average\r\n- **Visual Encryption**: <1ms for typical messages\r\n- **Public Key Size**: 0.4KB (vs 4MB in basic implementations)\r\n\r\n## Advanced Features\r\n\r\n### Batch Processing\r\n\r\n```python\r\nfrom clwe.core.batch_operations import batch_color_processor\r\n\r\nmessages = [\"msg1\", \"msg2\", \"msg3\"]\r\npasswords = [\"pwd1\", \"pwd2\", \"pwd3\"]\r\nencrypted_batch = batch_color_processor.batch_color_encryption(messages, passwords)\r\n```\r\n\r\n### Hardware Acceleration\r\n\r\n```python\r\nfrom clwe.core.hardware_acceleration import hardware_manager\r\n\r\n# Automatically uses available SIMD and multi-core capabilities\r\nperf_summary = hardware_manager.get_performance_summary()\r\n```\r\n\r\n### Side-Channel Protection\r\n\r\n```python\r\nfrom clwe.core.side_channel_protection import side_channel_protection\r\n\r\n# Validate security parameters\r\nvalidation = side_channel_protection.validate_security_hardness(256, 3329, 2)\r\n```\r\n\r\n## Documentation\r\n\r\n- [Usage Guide](USAGE_GUIDE.md) - Comprehensive usage examples\r\n- [Publishing Guide](PUBLISHING_GUIDE.md) - How to contribute and publish\r\n- [API Reference](docs/api.md) - Complete API documentation\r\n- [Performance Analysis](docs/performance.md) - Detailed benchmarks\r\n\r\n## Requirements\r\n\r\n- Python 3.8+\r\n- NumPy >= 1.19.0\r\n- cryptography >= 3.0.0\r\n- Pillow >= 8.0.0\r\n\r\n## License\r\n\r\nMIT License - see [LICENSE](LICENSE) for details.\r\n\r\n## Contributing\r\n\r\nWe welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\r\n\r\n## Citation\r\n\r\nIf you use CLWE in your research, please cite:\r\n\r\n```bibtex\r\n@software{clwe2025,\r\n title={CLWE: Color Lattice Learning with Errors},\r\n author={CLWE Development Team},\r\n year={2025},\r\n url={https://github.com/clwe-dev/clwe}\r\n}\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Color Lattice Learning with Errors - Post-Quantum Cryptographic Library by CryptoPIX",
"version": "0.0.0",
"project_urls": {
"Documentation": "https://cryptopix.in",
"Homepage": "https://cryptopix.in",
"Issues": "https://cryptopix.in",
"Repository": "https://cryptopix.in"
},
"split_keywords": [
"post-quantum",
" cryptography",
" lattice",
" visual-steganography"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "4dd91a3bc94c7c636c6aed0e82f4b17af274cb2808ef15a4b8cecb85c56473e9",
"md5": "b28204d42bc03f66bb895f98bddaf351",
"sha256": "2637abd90303b177414438b3081a2a818f65af8d00413eb43ab856c36c0ac7ca"
},
"downloads": -1,
"filename": "clwe-0.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b28204d42bc03f66bb895f98bddaf351",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 46561,
"upload_time": "2025-08-08T08:44:59",
"upload_time_iso_8601": "2025-08-08T08:44:59.330684Z",
"url": "https://files.pythonhosted.org/packages/4d/d9/1a3bc94c7c636c6aed0e82f4b17af274cb2808ef15a4b8cecb85c56473e9/clwe-0.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "63e5541154d9b9f66b3703794e91330ec02563d4161ab19ec8ec6bac471a9978",
"md5": "0d3f03aba7ec7739e2c96c5f3d2c936c",
"sha256": "2776cf8ab0d17fbab7ff1da5d5df1142d403a0af0c987f2c9153437d1cd4e2ac"
},
"downloads": -1,
"filename": "clwe-0.0.0.tar.gz",
"has_sig": false,
"md5_digest": "0d3f03aba7ec7739e2c96c5f3d2c936c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 93059,
"upload_time": "2025-08-08T08:45:02",
"upload_time_iso_8601": "2025-08-08T08:45:02.242257Z",
"url": "https://files.pythonhosted.org/packages/63/e5/541154d9b9f66b3703794e91330ec02563d4161ab19ec8ec6bac471a9978/clwe-0.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-08 08:45:02",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "clwe"
}