encrypt_tools
Project description
encrypt_tools: encrypt and decrypt
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
New features v1.0
BugFix
- choco install visualcpp-build-tools
Reference
- Jonathan Quiza github.
- Jonathan Quiza RumiMLSpark.
- Jonathan Quiza linkedin.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
encrypt_tools-0.0.2.tar.gz
(5.0 kB
view details)
Built Distribution
File details
Details for the file encrypt_tools-0.0.2.tar.gz
.
File metadata
- Download URL: encrypt_tools-0.0.2.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3761b3eded51108240f0b12021074d260ec83c2c59189760c5ee51f8f54ae53 |
|
MD5 | 6b428d6e49e7304e1ffc3fd67f18bdec |
|
BLAKE2b-256 | 480519059447b7f0b7cbee13771e69a6e61eea98b071a7b8ea843d975ea3bc2d |
File details
Details for the file encrypt_tools-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: encrypt_tools-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d23548d91608c41f6b4d2c3e34225242b8eb39b4f9a24feef89999d60b87161c |
|
MD5 | 4fa2b2c68ebe702b6cb83b567bb7487e |
|
BLAKE2b-256 | 10abe889ed3fe1a125959c0b1be25cc195a346613e70bf36ef88589c0107ac4e |