encrypt-tools-0.0.2
توضیحات
encrypt_tools
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | encrypt-tools-0.0.2 |
| نام | encrypt-tools |
| نسخه کتابخانه | 0.0.2 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Jonathan Quiza |
| ایمیل نویسنده | jony327@gmail.com |
| آدرس صفحه اصلی | https://github.com/jonaqp/encrypt_tools/ |
| آدرس اینترنتی | https://pypi.org/project/encrypt-tools/ |
| مجوز | - |
# encrypt_tools: encrypt and decrypt
[](https://opensource.org/licenses/Apache-2.0)
[](pyup)
[](pyup)
[](codecov)
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:
```sh
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](https://www.dropbox.com/s/8t6xtgk06o3ij61/LICENSE?dl=0).
## New features v1.0
## BugFix
- choco install visualcpp-build-tools
## Reference
- Jonathan Quiza [github](https://github.com/jonaqp).
- Jonathan Quiza [RumiMLSpark](http://rumi-ml.herokuapp.com/).
- Jonathan Quiza [linkedin](https://www.linkedin.com/in/jonaqp/).
نیازمندی
| مقدار | نام |
|---|---|
| >=3.10.1 | pycryptodome |
نحوه نصب
نصب پکیج whl encrypt-tools-0.0.2:
pip install encrypt-tools-0.0.2.whl
نصب پکیج tar.gz encrypt-tools-0.0.2:
pip install encrypt-tools-0.0.2.tar.gz