Python bindings for Sudarshan Engine - A high-performance cryptographic library providing post-quantum secure algorithms including KEM, signatures, symmetric encryption, and hashing.
Project description
Sudarshan Engine - Python Bindings
What is Sudarshan Engine?
Sudarshan Engine is a high-performance, post-quantum secure cryptographic library written in C, designed to provide robust cryptographic primitives for modern applications. It implements state-of-the-art cryptographic algorithms including:
- Post-Quantum Key Encapsulation Mechanisms (KEM): Kyber768 for quantum-resistant key exchange
- Digital Signatures: Dilithium for quantum-secure signatures
- Symmetric Encryption: AES-GCM for fast, secure data encryption
- Hash Functions: SHA3-512 for cryptographic hashing
- Key Derivation: HKDF for secure key derivation
- Random Number Generation: Cryptographically secure random bytes
The library is built with security, performance, and ease of use in mind, providing both low-level C APIs and high-level Python bindings.
Python Bindings Overview
The Python bindings (sudarshan-engine) provide a user-friendly interface to the Sudarshan Engine C library, allowing Python developers to easily integrate post-quantum cryptography into their applications.
Key Features:
- Complete ctypes-based bindings to the C library
- Pythonic API with automatic error handling
- Support for all major cryptographic operations
- Cross-platform compatibility (Linux, macOS, Windows)
- No external dependencies beyond the C library
Installation
pip install sudarshan-engine
Requirements:
- Python 3.6+
- The Sudarshan Engine shared library (
libsudarshan.soon Linux,libsudarshan.dylibon macOS,sudarshan.dllon Windows)
Quick Start
from sudarshan.crypto import create_engine, generate_kem_keypair, encrypt, decrypt
# Initialize the crypto engine
engine = create_engine()
# Generate a keypair for key encapsulation
public_key, secret_key = generate_kem_keypair(engine)
# Encrypt data
ciphertext = encrypt(engine, public_key, b"Hello, World!")
# Decrypt data
plaintext = decrypt(engine, secret_key, ciphertext)
print(plaintext) # b"Hello, World!"
API Reference
Core Functions
create_engine(): Initialize a new crypto engine instancecleanup_engine(engine): Clean up engine resourcesgenerate_kem_keypair(engine): Generate Kyber768 keypairkem_encapsulate(engine, public_key): Encapsulate shared secretkem_decapsulate(engine, secret_key, ciphertext): Decapsulate shared secretgenerate_sig_keypair(engine): Generate Dilithium signature keypairsign(engine, secret_key, message): Sign a messageverify(engine, public_key, message, signature): Verify a signaturesym_encrypt(engine, key, plaintext): Symmetric encryptionsym_decrypt(engine, key, ciphertext): Symmetric decryptionhash_sha3_512(data): Compute SHA3-512 hashkdf_hkdf(salt, ikm, info, length): Key derivation using HKDFrandom_bytes(length): Generate cryptographically secure random bytes
Project Structure
sudarshan_engine/
├── CMakeLists.txt # Main C build system
├── src/ # C core library source
│ ├── crypto.c
│ ├── crypto.h
│ └── ...
├── include/ # Public C headers
├── bindings/
│ └── python/ # Python bindings
│ ├── sudarshan/
│ │ ├── __init__.py
│ │ ├── crypto.py # High-level Python API
│ │ └── _bindings.py # Low-level ctypes bindings
│ ├── tests/
│ │ └── test_crypto.py
│ ├── setup.py
│ └── pyproject.toml
├── tests/ # C library tests
├── docs/ # Documentation
└── examples/ # Usage examples
Security Considerations
- All cryptographic operations are performed in the C library for maximum security
- Keys are handled securely with proper memory management
- The library uses post-quantum algorithms resistant to quantum attacks
- Regular security audits and updates are recommended
GitHub Repository
The complete source code, documentation, and examples are available at: https://github.com/yourusername/sudarshan_engine
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For questions, issues, or contributions:
- Open an issue on GitHub
- Check the documentation in the
docs/directory - Review the examples in the
examples/directory
Roadmap
- Additional post-quantum algorithms
- Hardware acceleration support
- WebAssembly bindings
- Integration with popular Python frameworks
- Performance optimizations
The Sudarshan Engine Python bindings provide a powerful, secure, and easy-to-use interface for integrating post-quantum cryptography into Python applications.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sudarshan_engine-1.0.0b7.tar.gz.
File metadata
- Download URL: sudarshan_engine-1.0.0b7.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ae84562c6527da6492393b450993a4a29ebe5c62d9f91e453a26292d3d3268f
|
|
| MD5 |
80d8223e1f8a1b9ba7c478eca288f867
|
|
| BLAKE2b-256 |
4b2e1a2b3013aae027a4c55101241d7ef20ffe470babfaa159eb3a1581a1d492
|
File details
Details for the file sudarshan_engine-1.0.0b7-py3-none-any.whl.
File metadata
- Download URL: sudarshan_engine-1.0.0b7-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8536f10ff6682b445391faf7ba8af37345e50551d1ff13a1791477cb16e96397
|
|
| MD5 |
ea82d68e7a879164b7788087b44ae14e
|
|
| BLAKE2b-256 |
54dc8b22012db8af17c6022f55e618fdb207034a1ef7837070b28a04ea8a0333
|