Skip to main content

Cryptographic utility package

An easy and simplified cryptographic utility package (fernet, RSA, hashes...) with some common encryption stuff already programmed (very simple and with common secure parameters by default). It uses the 'cryptography' module

Installation

pip install crypt-utilities

Modules

Symmetric

def encrypt ...
def encrypt_file ...
def decrypt_file ...

Hashes

def derive(data:bytes, salt:bytes, length:int=32, iterations=400000) -> bytes:...

Asymmetric

def rsa_encrypt (...
def generate_rsa_key_pairs (...
def generate_private_key (...
def serialize_pem_public_key (...
def load_pem_private_key (...

Usage Example

# Encrypt with RSA (asymmetric)
# -- John
secret_msg = "Very secret msg to send"
public_key = load_pem_public_key(file_path="./public_key")
encrypted:bytes = rsa_encrypt(secret_msg.encode(), public_key)
...
# Decrypt with RSA (asymmetric)
# -- Michael
private_key_path = str(input(" -> Introduce your private key file path: "))
password = str(input(" -> Introduce the private key password (blank if None was used): "))
if password == "":
    password = None
try:
    private_key = load_pem_private_key(file_path=private_key_path, password=password)
except :
    print("[!] Wrong Password"); exit(1)
secret_msg_sent_by_john = rsa_decrypt(encrypted, private_key).decode()

Release files for crypt-utilities 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for crypt-utilities 0.0.7
File Interpreter ABI Platform
crypt_utilities-0.0.7-py3-none-any.whl Python 3 none any Details

Release files / crypt_utilities-0.0.7-py3-none-any.whl

Download URL crypt_utilities-0.0.7-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2300f0f4f7fdc6632652c6c2e9fb332c9d836b094d6f41df4ca79ddc0e4370ec
BLAKE2b-256 checksum
How to use checksums
70998cdaf782ec2564a11170579bbd05e823bdbdb5b0259dd9f13fb58c0926ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.0.7 This release

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

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