๐Ÿš€ DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more โ†’
Socket
Book a DemoInstallSign in
Socket

cryptosystems

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cryptosystems

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.

pipPyPI
Version
1.0.0
Maintainers
1

๐šŒ๐š›๐šข๐š™๐š๐š˜๐šœ๐šข๐šœ๐š๐šŽ๐š–๐šœ

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

Keywords

cryptography

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts