A module for cryptography built from scratch, offering a robust suite of classes and functions for symmetric and asymmetric encryption, hashing algorithms, key exchange protocols as well as mathematical utility functions.
Project description
๐๐๐ข๐๐๐๐๐ข๐๐๐๐๐
Overview
The cryptosystems package offers a robust suite of classes and functions for symmetric and asymmetric encryption, hashing algorithms, key exchange protocols as well as mathematical utility functions. Designed for seamless encryption, decryption, and cryptographic operations, this package is lightweight and efficient, relying solely on Pythonโs built-in libraries: ctypes, warnings and hashlib. With almost all of the cryptographic logic implemented from scratch, cryptosystems provides a streamlined, dependency-free solution, ensuring consistency and reliability across different environments as well as Python versions.
๐ Changelog for cryptosystems v1.0.0 ๐
- ๐ Improved Performance with GMP ๐: Optimized performance using GMP for faster computations.
- ๐งฉ Modularized Codebase ๐งฉ: Refactored the codebase to be more modular for better maintainability and scalability.
- ๐ Updated Function Interfaces for Asymmetric Cryptosystems ๐: Revised function interfaces, with added
generate_keysfunctionality. - ๐ API Documentation Created ๐: Comprehensive API documentation has been created to assist with the usage of
cryptosystems, covering cryptosystem description, mathematical details, usage examples and more. - ๐ ๏ธ Modified Rabin implementation ๐ ๏ธ: Modified Rabin implementation with added functionality to verify plaintext using SHA-256 hash.
- ๐ง Fixed ElGamal errors ๐ง: Corrected the ElGamal implementation with a newly added
find_generatorfunction. - ๐ Extended Support for ECC Curves ๐: Added support for additional ECC curves, including Montgomery curves.
- ๐ SHA-512 Wrapper Added ๐: Added a wrapper for the SHA-512 algorithm to the
hash_functionssubmodule.
Key Features
- Dependency-Free ๐ซ๐ฆ: Operates solely on Python's built-in modules, eliminating the need for external libraries.
- Version Stability ๐๐ : Crafted to maintain consistent functionality across Python versions.
- Optimized for Performance โกโ๏ธ: Built from scratch for efficient and consistant cryptographic operations.
- Lightweight Codebase ๐ชถ๐ป: Minimalistic design ensures a low overhead and straightforward integration.
- Reliability and Security ๐๐ก๏ธ: Ensures robust encryption/decryption and hashing without reliance on third-party modules.
- Comprehensive Cryptosystem Support ๐๐: Offers a full suite of symmetric, asymmetric, and hashing methods.
Installation
To install the package, simply clone the repository and install the dependencies:
pip install cryptosystems
Usage
The general structure for usage is to create an object of the respective cryptosystem, with the key as argument if required. Similar usage for the utility functions as well. See docs for the exact reference example of a specific cryptosystem if required.
from cryptosystems import SomeCryptosystem
cipher = SomeCryptosystem()
ciphertext = cipher.encrypt("Hello World")
print(ciphertext) # Output: 'ciphertext string'
plaintext = cipher.decrypt(ciphertext)
print(plaintext) # Output: 'Hello World'
License
This project is licensed under the Apache License - see the LICENSE file for details.
Authors
- Ishan Surana - Inception, implementation and testing - GitHub
Acknowledgments
PyCryptodome, for the logic of functions in the functions submodule(Python-based implementation, discontinued from version v1.x onward)bcrypt.handgmp.h, for functions in the functions submodule
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 cryptosystems-1.0.0.tar.gz.
File metadata
- Download URL: cryptosystems-1.0.0.tar.gz
- Upload date:
- Size: 423.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d287dcc6385dfd2578aaa8ca492b4c1ef9c4803e6f37ee5a0bc1706afb7b391
|
|
| MD5 |
c360afd4100907071c9b392ffbfd3122
|
|
| BLAKE2b-256 |
a942a9907d0a1050ee22c7354035d9527f400f8148b4d994b1ac3bbb38053ef3
|
File details
Details for the file cryptosystems-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cryptosystems-1.0.0-py3-none-any.whl
- Upload date:
- Size: 424.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a7aa21601f2175e6452b5ecf3c35f0c59ad2dfb6b5fede34430696d3e50347b
|
|
| MD5 |
5f9f335f5c5eab5486f759fb3b6c952c
|
|
| BLAKE2b-256 |
5db1cbbbc7ef787b0d208c0341f7fbe6b26e373fd8de122dc53332ed1324533c
|