Skip to main content

𝚌𝚛𝚢𝚙𝚝𝚘𝚜𝚢𝚜𝚝𝚎𝚖𝚜

Licence Python Wheel Maintained OS Documentation Status

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_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:

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.h and gmp.h, for functions in the functions submodule

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cryptosystems-1.0.0.tar.gz (423.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cryptosystems-1.0.0-py3-none-any.whl (424.9 kB view details)

Uploaded Python 3

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

Hashes for cryptosystems-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3d287dcc6385dfd2578aaa8ca492b4c1ef9c4803e6f37ee5a0bc1706afb7b391
MD5 c360afd4100907071c9b392ffbfd3122
BLAKE2b-256 a942a9907d0a1050ee22c7354035d9527f400f8148b4d994b1ac3bbb38053ef3

See more details on using hashes here.

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

Hashes for cryptosystems-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a7aa21601f2175e6452b5ecf3c35f0c59ad2dfb6b5fede34430696d3e50347b
MD5 5f9f335f5c5eab5486f759fb3b6c952c
BLAKE2b-256 5db1cbbbc7ef787b0d208c0341f7fbe6b26e373fd8de122dc53332ed1324533c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page