Skip to main content

A high-level cryptography library for symmetric and asymmetric operations.

Project description

StreamlinedCryptography

StreamlinedCryptography is a Python library that provides a simple and easy-to-use interface for encryption and decryption. It is built on top of the popular cryptography library and provides a high-level API for common cryptographic operations.

Features

  • Symmetric encryption and decryption (AES-GCM)
  • Asymmetric encryption and decryption (Elliptic Curve SECP256R1)
  • High-level abstractions for common cryptographic operations
  • Strict type enforcement

Installation

You can install StreamlinedCryptography using pip:

pip install StreamlinedCryptography

Usage

Here's an example of how you can use StreamlinedCryptography to encrypt and decrypt a message:

from StreamlinedCryptography import encrypt_symmetric, decrypt_symmetric, SymmetricEncryptResult

data = b"Test Message"
password = b"Password"

encrypted = encrypt_symmetric(password, data)  # Encrypted data is a SymmetricEncryptResult object
serialized = encrypted.serialize()

deserialized = SymmetricEncryptResult.from_serialized(serialized)
decrypted = decrypt_symmetric(password, deserialized)

print(decrypted.decode("utf-8"))

and here's an example of how you can use StreamlinedCryptography to encrypt and decrypt a message using asymmetric encryption:

from StreamlinedCryptography import encrypt_symmetric, decrypt_symmetric, SymmetricEncryptResult  # Symmetric imports
from StreamlinedCryptography import derive_secret, AsymmetricPrivateKey, AsymmetricPublicKey  # Asymmetric imports

# Using ECC to derive a shared secret

data = b"Test Message"

alice_private_key = AsymmetricPrivateKey.generate()
alice_public_key = AsymmetricPublicKey.from_private_key(alice_private_key)

bob_private_key = AsymmetricPrivateKey.generate()
bob_public_key = AsymmetricPublicKey.from_private_key(bob_private_key)

alice_secret = derive_secret(alice_private_key, bob_public_key)
bob_secret = derive_secret(bob_private_key, alice_public_key)

assert alice_secret == bob_secret  # The shared secret is the same for both parties

# Using the shared secret to encrypt and decrypt data

encrypted = encrypt_symmetric(alice_secret, data)  # Encrypted data is a SymmetricEncryptResult object

decrypted = decrypt_symmetric(bob_secret, encrypted)

print(decrypted.decode("utf-8"))

License

StreamlinedCryptography is licensed under the MIT license. See the LICENSE file for more information.

Requirements

StreamlinedCryptography was built and tested on Python 3.12, I am unsure if it will work on earlier versions of Python.
StreamlinedCryptography requires the cryptography library.

Acknowledgements

StreamlinedCryptography is built on top of the cryptography library. We would like to thank the authors and contributors of the cryptography library for their hard work and dedication.

Project details


Download files

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

Source Distribution

streamlinedcryptography-1.0.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

StreamlinedCryptography-1.0.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file streamlinedcryptography-1.0.0.tar.gz.

File metadata

  • Download URL: streamlinedcryptography-1.0.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for streamlinedcryptography-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0b2c77cf69f681694f426a64b684f2929eef515cff873cde1723bcac4578607b
MD5 5420b93c6900b9f05a0f56b9f9da98c0
BLAKE2b-256 0bfcfae764a91755479b933dd4a466c310dc53e64c295ac8f81d15bbe5f7e4a1

See more details on using hashes here.

File details

Details for the file StreamlinedCryptography-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for StreamlinedCryptography-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9352d8718c0ccc318e43f7adb6ba1ed048788af3ec379f261e2c21759cb75c0f
MD5 fa86c9097b28175732e438e0dc6ca0d9
BLAKE2b-256 719ba8be99c5703badfc75682e088d400600fd8897139abb72b7a7aa8cebe2cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page