# Cryptography Suite
[![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
[![Platform](https://img.shields.io/badge/platform-macOS%20|%20Linux%20|%20Windows-informational)]()
[![Build Status](https://github.com/Psychevus/cryptography-suite/actions/workflows/python-app.yml/badge.svg)](https://github.com/Psychevus/cryptography-suite/actions)
[![Coverage Status](https://coveralls.io/repos/github/Psychevus/cryptography-suite/badge.svg?branch=main)](https://coveralls.io/github/Psychevus/cryptography-suite?branch=main)
[![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](CONTRIBUTING.md)
**Cryptography Suite** is an advanced cryptographic toolkit for Python, meticulously engineered for applications demanding robust security and seamless integration. It offers a comprehensive set of cryptographic primitives and protocols, empowering developers and organizations to implement state-of-the-art encryption, hashing, key management, digital signatures, and more.
---
## ๐ Why Choose Cryptography Suite?
- **Comprehensive Functionality**: Access a wide array of cryptographic algorithms and protocols, including symmetric and asymmetric encryption, digital signatures, key management, secret sharing, password-authenticated key exchange (PAKE), and one-time passwords (OTP).
- **High Security Standards**: Implements industry-leading algorithms with best practices, ensuring your data is safeguarded with the highest level of security.
- **Developer-Friendly API**: Offers intuitive and well-documented APIs that simplify integration and accelerate development.
- **Cross-Platform Compatibility**: Fully compatible with macOS, Linux, and Windows environments.
- **Rigorous Testing**: Achieves **98% code coverage** with a comprehensive test suite, guaranteeing reliability and robustness.
---
## ๐ฆ Installation
### Install via pip
Install the latest stable release from PyPI:
```bash
pip install cryptography-suite
```
> **Note**: Requires Python 3.8 or higher.
### Install from Source
Clone the repository and install manually:
```bash
git clone https://github.com/Psychevus/cryptography-suite.git
cd cryptography-suite
pip install .
```
---
## ๐ Key Features
- **Symmetric Encryption**: AES-GCM, ChaCha20-Poly1305 encryption with password-based key derivation using PBKDF2 and Scrypt.
- **Asymmetric Encryption**: RSA encryption/decryption, key generation, serialization, and loading.
- **Digital Signatures**: Support for Ed25519 and ECDSA algorithms for secure message signing and verification.
- **Hashing Functions**: Implements SHA-256, SHA-384, SHA-512, and BLAKE2b hashing algorithms.
- **Key Management**: Secure generation, storage, loading, and rotation of cryptographic keys.
- **Secret Sharing**: Implementation of Shamir's Secret Sharing scheme for splitting and reconstructing secrets.
- **Password-Authenticated Key Exchange (PAKE)**: SPAKE2 protocol implementation for secure password-based key exchange.
- **One-Time Passwords (OTP)**: HOTP and TOTP algorithms for generating and verifying one-time passwords.
- **Utility Functions**: Includes Base62 encoding/decoding, secure random string generation, and memory zeroing.
---
## ๐ก Usage Examples
### Symmetric Encryption
Encrypt and decrypt messages using AES-GCM with password-derived keys.
```python
from cryptography_suite.encryption import aes_encrypt, aes_decrypt
message = "Highly Confidential Information"
password = "ultra_secure_password"
# Encrypt the message
encrypted_message = aes_encrypt(message, password)
print(f"Encrypted: {encrypted_message}")
# Decrypt the message
decrypted_message = aes_decrypt(encrypted_message, password)
print(f"Decrypted: {decrypted_message}")
```
### Asymmetric Encryption
Generate RSA key pairs and perform encryption/decryption.
```python
from cryptography_suite.asymmetric import generate_rsa_keypair, rsa_encrypt, rsa_decrypt
# Generate RSA key pair
private_key, public_key = generate_rsa_keypair()
message = b"Secure Data Transfer"
# Encrypt the message
encrypted_message = rsa_encrypt(message, public_key)
print(f"Encrypted: {encrypted_message}")
# Decrypt the message
decrypted_message = rsa_decrypt(encrypted_message, private_key)
print(f"Decrypted: {decrypted_message}")
```
### Digital Signatures
Sign and verify messages using Ed25519.
```python
from cryptography_suite.signatures import generate_ed25519_keypair, sign_message, verify_signature
# Generate key pair
private_key, public_key = generate_ed25519_keypair()
message = b"Authenticate this message"
# Sign the message
signature = sign_message(message, private_key)
# Verify the signature
is_valid = verify_signature(message, signature, public_key)
print(f"Signature valid: {is_valid}")
```
### Secret Sharing
Split and reconstruct secrets using Shamir's Secret Sharing.
```python
from cryptography_suite.secret_sharing import create_shares, reconstruct_secret
secret = 1234567890
threshold = 3
num_shares = 5
# Create shares
shares = create_shares(secret, threshold, num_shares)
# Reconstruct the secret
selected_shares = shares[:threshold]
recovered_secret = reconstruct_secret(selected_shares)
print(f"Recovered secret: {recovered_secret}")
```
---
## ๐งช Running Tests
Ensure the integrity of the suite by running comprehensive tests:
```bash
coverage run -m unittest discover
coverage report -m
```
Our test suite achieves **98% code coverage**, guaranteeing reliability and robustness.
---
## ๐ Security Best Practices
- **Secure Key Storage**: Store private keys securely, using encrypted files or hardware security modules (HSMs).
- **Password Management**: Use strong, unique passwords and consider integrating with secret management solutions.
- **Key Rotation**: Regularly rotate cryptographic keys to minimize potential exposure.
- **Environment Variables**: Use environment variables for sensitive configurations to prevent hardcoding secrets.
- **Regular Updates**: Keep dependencies up to date to benefit from the latest security patches.
---
## ๐ Advanced Usage & Customization
- **Custom Encryption Modes**: Extend the suite by implementing additional encryption algorithms or modes tailored to your needs.
- **Adjustable Key Sizes**: Customize RSA or AES key sizes to meet specific security and performance requirements.
- **Integration with Other Libraries**: Seamlessly integrate with other Python libraries and frameworks for enhanced functionality.
- **Optimized Performance**: Utilize performance profiling tools to optimize cryptographic operations in high-load environments.
---
## ๐ Project Structure
```plaintext
cryptography-suite/
โโโ cryptography_suite/
โ โโโ __init__.py
โ โโโ asymmetric.py
โ โโโ encryption.py
โ โโโ hashing.py
โ โโโ key_management.py
โ โโโ otp.py
โ โโโ pake.py
โ โโโ secret_sharing.py
โ โโโ signatures.py
โ โโโ utils.py
โโโ tests/
โ โโโ test_asymmetric.py
โ โโโ test_encryption.py
โ โโโ test_hashing.py
โ โโโ test_key_management.py
โ โโโ test_otp.py
โ โโโ test_pake.py
โ โโโ test_secret_sharing.py
โ โโโ test_signatures.py
โ โโโ test_utils.py
โโโ README.md
โโโ setup.py
โโโ LICENSE
โโโ .github/
โโโ workflows/
โโโ python-app.yml
```
---
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
## ๐ค Contributions
We welcome contributions from the community. To contribute:
1. **Fork the Repository**: Click on the 'Fork' button at the top right corner of the repository page.
2. **Create a New Branch**: Use a descriptive name for your branch (e.g., `feature/new-algorithm`).
3. **Commit Your Changes**: Make sure to write clear, concise commit messages.
4. **Push to GitHub**: Push your changes to your forked repository.
5. **Submit a Pull Request**: Open a pull request to the `main` branch of the original repository.
Please ensure that your contributions adhere to the project's coding standards and include relevant tests.
---
## ๐ฌ Contact
For support or inquiries:
- **Email**: [psychevus@gmail.com](mailto:psychevus@gmail.com)
- **GitHub Issues**: [Create an Issue](https://github.com/Psychevus/cryptography-suite/issues)
---
## ๐ Acknowledgements
Special thanks to all contributors and users who have helped improve this project through feedback and collaboration.
---
*Empower your applications with secure and reliable cryptographic functions using Cryptography Suite.*
Raw data
{
"_id": null,
"home_page": "https://github.com/Psychevus/cryptography-suite",
"name": "cryptography-suite",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "cryptography, encryption, security, AES, RSA, ChaCha20, Ed25519, ECDSA, hashing, PAKE, OTP, secret sharing",
"author": "Mojtaba Zaferanloo",
"author_email": "psychevus@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e2/cd/58c6cc303f792823b3cd4a0300bc5fe79fbebebc38068847a2c1183dd203/cryptography_suite-1.0.0.tar.gz",
"platform": null,
"description": "# Cryptography Suite\r\n\r\n[![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)](https://www.python.org/downloads/)\r\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\r\n[![Platform](https://img.shields.io/badge/platform-macOS%20|%20Linux%20|%20Windows-informational)]()\r\n[![Build Status](https://github.com/Psychevus/cryptography-suite/actions/workflows/python-app.yml/badge.svg)](https://github.com/Psychevus/cryptography-suite/actions)\r\n[![Coverage Status](https://coveralls.io/repos/github/Psychevus/cryptography-suite/badge.svg?branch=main)](https://coveralls.io/github/Psychevus/cryptography-suite?branch=main)\r\n[![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](CONTRIBUTING.md)\r\n\r\n**Cryptography Suite** is an advanced cryptographic toolkit for Python, meticulously engineered for applications demanding robust security and seamless integration. It offers a comprehensive set of cryptographic primitives and protocols, empowering developers and organizations to implement state-of-the-art encryption, hashing, key management, digital signatures, and more.\r\n\r\n---\r\n\r\n## \ud83d\ude80 Why Choose Cryptography Suite?\r\n\r\n- **Comprehensive Functionality**: Access a wide array of cryptographic algorithms and protocols, including symmetric and asymmetric encryption, digital signatures, key management, secret sharing, password-authenticated key exchange (PAKE), and one-time passwords (OTP).\r\n- **High Security Standards**: Implements industry-leading algorithms with best practices, ensuring your data is safeguarded with the highest level of security.\r\n- **Developer-Friendly API**: Offers intuitive and well-documented APIs that simplify integration and accelerate development.\r\n- **Cross-Platform Compatibility**: Fully compatible with macOS, Linux, and Windows environments.\r\n- **Rigorous Testing**: Achieves **98% code coverage** with a comprehensive test suite, guaranteeing reliability and robustness.\r\n\r\n---\r\n\r\n## \ud83d\udce6 Installation\r\n\r\n### Install via pip\r\n\r\nInstall the latest stable release from PyPI:\r\n\r\n```bash\r\npip install cryptography-suite\r\n```\r\n\r\n> **Note**: Requires Python 3.8 or higher.\r\n\r\n### Install from Source\r\n\r\nClone the repository and install manually:\r\n\r\n```bash\r\ngit clone https://github.com/Psychevus/cryptography-suite.git\r\ncd cryptography-suite\r\npip install .\r\n```\r\n\r\n---\r\n\r\n## \ud83d\udd11 Key Features\r\n\r\n- **Symmetric Encryption**: AES-GCM, ChaCha20-Poly1305 encryption with password-based key derivation using PBKDF2 and Scrypt.\r\n- **Asymmetric Encryption**: RSA encryption/decryption, key generation, serialization, and loading.\r\n- **Digital Signatures**: Support for Ed25519 and ECDSA algorithms for secure message signing and verification.\r\n- **Hashing Functions**: Implements SHA-256, SHA-384, SHA-512, and BLAKE2b hashing algorithms.\r\n- **Key Management**: Secure generation, storage, loading, and rotation of cryptographic keys.\r\n- **Secret Sharing**: Implementation of Shamir's Secret Sharing scheme for splitting and reconstructing secrets.\r\n- **Password-Authenticated Key Exchange (PAKE)**: SPAKE2 protocol implementation for secure password-based key exchange.\r\n- **One-Time Passwords (OTP)**: HOTP and TOTP algorithms for generating and verifying one-time passwords.\r\n- **Utility Functions**: Includes Base62 encoding/decoding, secure random string generation, and memory zeroing.\r\n\r\n---\r\n\r\n## \ud83d\udca1 Usage Examples\r\n\r\n### Symmetric Encryption\r\n\r\nEncrypt and decrypt messages using AES-GCM with password-derived keys.\r\n\r\n```python\r\nfrom cryptography_suite.encryption import aes_encrypt, aes_decrypt\r\n\r\nmessage = \"Highly Confidential Information\"\r\npassword = \"ultra_secure_password\"\r\n\r\n# Encrypt the message\r\nencrypted_message = aes_encrypt(message, password)\r\nprint(f\"Encrypted: {encrypted_message}\")\r\n\r\n# Decrypt the message\r\ndecrypted_message = aes_decrypt(encrypted_message, password)\r\nprint(f\"Decrypted: {decrypted_message}\")\r\n```\r\n\r\n### Asymmetric Encryption\r\n\r\nGenerate RSA key pairs and perform encryption/decryption.\r\n\r\n```python\r\nfrom cryptography_suite.asymmetric import generate_rsa_keypair, rsa_encrypt, rsa_decrypt\r\n\r\n# Generate RSA key pair\r\nprivate_key, public_key = generate_rsa_keypair()\r\n\r\nmessage = b\"Secure Data Transfer\"\r\n\r\n# Encrypt the message\r\nencrypted_message = rsa_encrypt(message, public_key)\r\nprint(f\"Encrypted: {encrypted_message}\")\r\n\r\n# Decrypt the message\r\ndecrypted_message = rsa_decrypt(encrypted_message, private_key)\r\nprint(f\"Decrypted: {decrypted_message}\")\r\n```\r\n\r\n### Digital Signatures\r\n\r\nSign and verify messages using Ed25519.\r\n\r\n```python\r\nfrom cryptography_suite.signatures import generate_ed25519_keypair, sign_message, verify_signature\r\n\r\n# Generate key pair\r\nprivate_key, public_key = generate_ed25519_keypair()\r\n\r\nmessage = b\"Authenticate this message\"\r\n\r\n# Sign the message\r\nsignature = sign_message(message, private_key)\r\n\r\n# Verify the signature\r\nis_valid = verify_signature(message, signature, public_key)\r\nprint(f\"Signature valid: {is_valid}\")\r\n```\r\n\r\n### Secret Sharing\r\n\r\nSplit and reconstruct secrets using Shamir's Secret Sharing.\r\n\r\n```python\r\nfrom cryptography_suite.secret_sharing import create_shares, reconstruct_secret\r\n\r\nsecret = 1234567890\r\nthreshold = 3\r\nnum_shares = 5\r\n\r\n# Create shares\r\nshares = create_shares(secret, threshold, num_shares)\r\n\r\n# Reconstruct the secret\r\nselected_shares = shares[:threshold]\r\nrecovered_secret = reconstruct_secret(selected_shares)\r\nprint(f\"Recovered secret: {recovered_secret}\")\r\n```\r\n\r\n---\r\n\r\n## \ud83e\uddea Running Tests\r\n\r\nEnsure the integrity of the suite by running comprehensive tests:\r\n\r\n```bash\r\ncoverage run -m unittest discover\r\ncoverage report -m\r\n```\r\n\r\nOur test suite achieves **98% code coverage**, guaranteeing reliability and robustness.\r\n\r\n---\r\n\r\n## \ud83d\udd12 Security Best Practices\r\n\r\n- **Secure Key Storage**: Store private keys securely, using encrypted files or hardware security modules (HSMs).\r\n- **Password Management**: Use strong, unique passwords and consider integrating with secret management solutions.\r\n- **Key Rotation**: Regularly rotate cryptographic keys to minimize potential exposure.\r\n- **Environment Variables**: Use environment variables for sensitive configurations to prevent hardcoding secrets.\r\n- **Regular Updates**: Keep dependencies up to date to benefit from the latest security patches.\r\n\r\n---\r\n\r\n## \ud83d\udee0 Advanced Usage & Customization\r\n\r\n- **Custom Encryption Modes**: Extend the suite by implementing additional encryption algorithms or modes tailored to your needs.\r\n- **Adjustable Key Sizes**: Customize RSA or AES key sizes to meet specific security and performance requirements.\r\n- **Integration with Other Libraries**: Seamlessly integrate with other Python libraries and frameworks for enhanced functionality.\r\n- **Optimized Performance**: Utilize performance profiling tools to optimize cryptographic operations in high-load environments.\r\n\r\n---\r\n\r\n## \ud83d\udcda Project Structure\r\n\r\n```plaintext\r\ncryptography-suite/\r\n\u251c\u2500\u2500 cryptography_suite/\r\n\u2502 \u251c\u2500\u2500 __init__.py\r\n\u2502 \u251c\u2500\u2500 asymmetric.py\r\n\u2502 \u251c\u2500\u2500 encryption.py\r\n\u2502 \u251c\u2500\u2500 hashing.py\r\n\u2502 \u251c\u2500\u2500 key_management.py\r\n\u2502 \u251c\u2500\u2500 otp.py\r\n\u2502 \u251c\u2500\u2500 pake.py\r\n\u2502 \u251c\u2500\u2500 secret_sharing.py\r\n\u2502 \u251c\u2500\u2500 signatures.py\r\n\u2502 \u2514\u2500\u2500 utils.py\r\n\u251c\u2500\u2500 tests/\r\n\u2502 \u251c\u2500\u2500 test_asymmetric.py\r\n\u2502 \u251c\u2500\u2500 test_encryption.py\r\n\u2502 \u251c\u2500\u2500 test_hashing.py\r\n\u2502 \u251c\u2500\u2500 test_key_management.py\r\n\u2502 \u251c\u2500\u2500 test_otp.py\r\n\u2502 \u251c\u2500\u2500 test_pake.py\r\n\u2502 \u251c\u2500\u2500 test_secret_sharing.py\r\n\u2502 \u251c\u2500\u2500 test_signatures.py\r\n\u2502 \u2514\u2500\u2500 test_utils.py\r\n\u251c\u2500\u2500 README.md\r\n\u251c\u2500\u2500 setup.py\r\n\u251c\u2500\u2500 LICENSE\r\n\u2514\u2500\u2500 .github/\r\n \u2514\u2500\u2500 workflows/\r\n \u2514\u2500\u2500 python-app.yml\r\n```\r\n\r\n---\r\n\r\n## \ud83d\udcdc License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n---\r\n\r\n## \ud83e\udd1d Contributions\r\n\r\nWe welcome contributions from the community. To contribute:\r\n\r\n1. **Fork the Repository**: Click on the 'Fork' button at the top right corner of the repository page.\r\n2. **Create a New Branch**: Use a descriptive name for your branch (e.g., `feature/new-algorithm`).\r\n3. **Commit Your Changes**: Make sure to write clear, concise commit messages.\r\n4. **Push to GitHub**: Push your changes to your forked repository.\r\n5. **Submit a Pull Request**: Open a pull request to the `main` branch of the original repository.\r\n\r\nPlease ensure that your contributions adhere to the project's coding standards and include relevant tests.\r\n\r\n---\r\n\r\n## \ud83d\udcec Contact\r\n\r\nFor support or inquiries:\r\n\r\n- **Email**: [psychevus@gmail.com](mailto:psychevus@gmail.com)\r\n- **GitHub Issues**: [Create an Issue](https://github.com/Psychevus/cryptography-suite/issues)\r\n\r\n---\r\n\r\n## \ud83c\udf1f Acknowledgements\r\n\r\nSpecial thanks to all contributors and users who have helped improve this project through feedback and collaboration.\r\n\r\n---\r\n\r\n*Empower your applications with secure and reliable cryptographic functions using Cryptography Suite.*\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A comprehensive and secure cryptographic toolkit.",
"version": "1.0.0",
"project_urls": {
"Documentation": "https://github.com/Psychevus/cryptography-suite#readme",
"Homepage": "https://github.com/Psychevus/cryptography-suite",
"Source": "https://github.com/Psychevus/cryptography-suite",
"Tracker": "https://github.com/Psychevus/cryptography-suite/issues"
},
"split_keywords": [
"cryptography",
" encryption",
" security",
" aes",
" rsa",
" chacha20",
" ed25519",
" ecdsa",
" hashing",
" pake",
" otp",
" secret sharing"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "072df43c3e8beb211e45f390b52ec70eb317836c6a828aadcba8cea618b7bd0f",
"md5": "f713190f494c17afb5898e7b3e93e246",
"sha256": "9dc8e414bf8e2c1d17fb6d01fb6ffe374ca91de6fe7b1d9523a34fc92449e14b"
},
"downloads": -1,
"filename": "cryptography_suite-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f713190f494c17afb5898e7b3e93e246",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 16757,
"upload_time": "2024-12-04T15:05:08",
"upload_time_iso_8601": "2024-12-04T15:05:08.270546Z",
"url": "https://files.pythonhosted.org/packages/07/2d/f43c3e8beb211e45f390b52ec70eb317836c6a828aadcba8cea618b7bd0f/cryptography_suite-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e2cd58c6cc303f792823b3cd4a0300bc5fe79fbebebc38068847a2c1183dd203",
"md5": "2ce628de9cef2bc6dadc05e59ef9b335",
"sha256": "0a67482607f06f85fd8500ae7ad529d9b8193b6580edc581a998ac4a213f8e96"
},
"downloads": -1,
"filename": "cryptography_suite-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "2ce628de9cef2bc6dadc05e59ef9b335",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 23384,
"upload_time": "2024-12-04T15:05:10",
"upload_time_iso_8601": "2024-12-04T15:05:10.392508Z",
"url": "https://files.pythonhosted.org/packages/e2/cd/58c6cc303f792823b3cd4a0300bc5fe79fbebebc38068847a2c1183dd203/cryptography_suite-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-04 15:05:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Psychevus",
"github_project": "cryptography-suite",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [
{
"name": "cryptography",
"specs": [
[
"~=",
"43.0.3"
]
]
}
],
"lcname": "cryptography-suite"
}