K9Crypt is a powerful Python library that provides multi-layer encryption. It securely protects your data using five different AES-256-based encryption modes.
- 5-layer AES-256 encryption (GCM, CBC, CFB, OFB, CTR)
- Strong key derivation with PBKDF2
- HMAC-SHA512 verification at each layer
- Brotli compression support
- Asynchronous (async/await) API
- Protection against timing attacks
pip install k9crypt
from k9crypt import K9Crypt
import asyncio
async def test():
secret_key = "VeryLongSecretKey!@#1234567890"
encryptor = K9Crypt(secret_key)
plaintext = "Hello, World!"
try:
encrypted = await encryptor.encrypt(plaintext)
print("Encrypted data:", encrypted)
decrypted = await encryptor.decrypt(encrypted)
print("Decrypted data:", decrypted)
except Exception as error:
print("Encryption error:", str(error))
asyncio.run(test())
- Multi-Layer Encryption: Each layer uses a different AES-256 mode
- HMAC Verification: Integrity check at each layer
- Strong Key Derivation: 600,000 iterations with PBKDF2
- Secure Comparison: Protection against timing attacks
- Salt and Pepper: Unique salt used for each encryption
- Python 3.7+
- cryptography>=41.0.7
- brotli>=1.1.0
MIT License
- Fork this repository
- Create a new branch (
git checkout -b feature/new-feature
) - Commit your changes (
git commit -am 'Added new feature'
) - Push your branch (
git push origin feature/new-feature
) - Create a Pull Request