Skip to main content

encrypt_tools: encrypt and decrypt

Github License Updates Python 3 Code coverage

encrypt_tools is a Python package of low-level cryptographic primitives.

Installation

The code is packaged for PyPI, so that the installation consists in running:

pip install encrypt-tools

Usage AES

from encrypt_tools import CryptoAes
from encrypt_tools import generate_b64decode

KEY = generate_b64decode("onAGSOj7NXlJo0xo5iorF3vQT+ip/uRBcZDMuEljyCo=")
IV = generate_b64decode("WvdNOBeWH+nApbbqz/WAZg==")

cipher = CryptoAes()
text = "51123456789"

encrypt = cipher.encrypt(text, KEY, IV)
print(f'encrypt:\n{encrypt}')

decrypt = cipher.decrypt(encrypt, KEY, IV)
print(f'decrypt:\n{decrypt}')

Usage RSA

from encrypt_tools import CrypyoRsa
from encrypt_tools import generate_key_pair

cipher = CrypyoRsa()
text = "51955376623"

passphrase_private = "passphrase_private"
passphrase_public = "passphrase_public"
generate_key_pair(passphrase_private,
                  passphrase_public)

encrypt = cipher.encrypt(text, passphrase_public)
print(f'encrypt:\n{encrypt}')

decrypt = cipher.decrypt(encrypt, passphrase_private)
print(f'decrypt:\n{decrypt}')

Usage RSA Files

from encrypt_tools import CryptoFiles
from pathlib import Path

cipher = CryptoFiles()
text = "51955376623"
passphrase_private = "passphrase_private"
passphrase_public = "passphrase_public"

private_key = Path('private.pem')
public_key = Path('public.pem')
unencrypted_file = Path('file.txt')

encrypt = cipher.encrypt(unencrypted_file, public_key, passphrase_public)
print(f'encrypt:\n{encrypt}')


decrypt = cipher.decrypt(encrypt, private_key, passphrase_private)
print(f'decrypt:\n{decrypt}')

License

Apache License 2.0.

New features v1.0

BugFix

  • choco install visualcpp-build-tools

Reference

Metadata

Release files for encrypt-tools 0.0.2

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

Source distribution (sdist)

Source distribution for encrypt-tools 0.0.2
File Size Uploaded
encrypt_tools-0.0.2.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for encrypt-tools 0.0.2
File Interpreter ABI Platform
encrypt_tools-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / encrypt_tools-0.0.2.tar.gz

Download URL encrypt_tools-0.0.2.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f3761b3eded51108240f0b12021074d260ec83c2c59189760c5ee51f8f54ae53
BLAKE2b-256 checksum
How to use checksums
480519059447b7f0b7cbee13771e69a6e61eea98b071a7b8ea843d975ea3bc2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

Release files / encrypt_tools-0.0.2-py3-none-any.whl

Download URL encrypt_tools-0.0.2-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d23548d91608c41f6b4d2c3e34225242b8eb39b4f9a24feef89999d60b87161c
BLAKE2b-256 checksum
How to use checksums
10abe889ed3fe1a125959c0b1be25cc195a346613e70bf36ef88589c0107ac4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release 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