https://github.com/ishan-surana/cryptosystems
The πππ’πππππ’πππππ package offers a suite of classes and functions for both symmetric and asymmetric encryption, signature-verification, hashing algorithms, key exchange protocols as well as mathematical utility functions. Docs at https://cryptosystems.readthedocs.io.
https://github.com/ishan-surana/cryptosystems
asymmetric-cryptography bcrypt cryptography cryptography-algorithms cryptography-library cryptosystems gmp gmplib hashing-algorithm key-exchange-protocol mathematical-functions mathematical-utilities python-package python3 signature-verification symmetric-key-cryptography
Last synced: 3 months ago
JSON representation
The πππ’πππππ’πππππ package offers a suite of classes and functions for both symmetric and asymmetric encryption, signature-verification, hashing algorithms, key exchange protocols as well as mathematical utility functions. Docs at https://cryptosystems.readthedocs.io.
- Host: GitHub
- URL: https://github.com/ishan-surana/cryptosystems
- Owner: ishan-surana
- License: apache-2.0
- Created: 2024-10-29T05:11:01.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-12-21T07:23:33.000Z (10 months ago)
- Last Synced: 2025-06-14T17:40:59.455Z (4 months ago)
- Topics: asymmetric-cryptography, bcrypt, cryptography, cryptography-algorithms, cryptography-library, cryptosystems, gmp, gmplib, hashing-algorithm, key-exchange-protocol, mathematical-functions, mathematical-utilities, python-package, python3, signature-verification, symmetric-key-cryptography
- Language: HTML
- Homepage: https://pypi.org/project/cryptosystems/
- Size: 4.22 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![]()
πππ’πππππ’πππππ
[](https://github.com/ishan-surana/cryptosystems/blob/main/LICENCE)
[](https://www.python.org/downloads/release/python-3119/)
[](https://pypi.org/project/cryptosystems/#files)
[](https://github.com/ishan-surana/MetaDataScraper/pulse)
[](https://www.microsoft.com/software-download/windows11)
[](https://cryptosystems.readthedocs.io/en/latest/?badge=latest)## Overview
The `cryptosystems` package offers a 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.> [!WARNING]
> As of now, this library stands as a personal project of mine. It has not been audited by any authority. It also contains many basic symmetric ciphers, which should be used ONLY for educational purposes, and NOT in production. The same point stands for other cryptosystems due to appropriate padding schemes not formed yet, and the project not having been formally verified. Please do not use this library in production until it is audited and certified.## π 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_keys` functionality.
- **π 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_generator` function.
- **π 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_functions` submodule.## 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:
```bash
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](https://cryptosystems.readthedocs.io/en/latest/) for the exact reference example of a specific cryptosystem if required.
```python
from cryptosystems import SomeCryptosystemcipher = 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](LICENCE) file for details.## Authors
- **Ishan Surana** - *Inception, implementation and testing* - [GitHub](https://github.com/ishan-surana)## Acknowledgments
- ~~PyCryptodome, for the logic of functions in the [functions submodule](cryptosystems/functions.py)~~ (Python-based implementation, discontinued from version v1.x onward)
- `bcrypt.h` and `gmp.h`, for functions in the [functions submodule](cryptosystems/functions.py)