A tiny asymmetric/symmetric encryption lib for humans.
Project description
kripta-py
An simple implementation of a Symmetric(AES) and Asymmetric(RSA) encryption based on pycryptodome module.
Requirements
- Python (3.10 recommended)
Features
- Generate RSA keys like
- Encrypt/Decrypt messages, files, binaries on symmetric or asymmetric
How to use
- Install the lib
pip install kripta-py
-
To use the symmetric encryption (AES):
-
Schema :
-
Code :
from kripta_py import KriptaAES message = "secret-message" secret_key = "secret-code-password" k = KriptaAES() # to encrypt encrypted_msg = k.encrypt(message, secret_key) # to decrypt print(k.decrypt(encrypted_msg1, secret_key).decode()) # secret-message
-
-
To use an asymmetric encryption (RSA):
-
Schema :
-
Code example:
from kripta_py import KriptaRSA message = "secret-message" pub_key = """-----BEGIN PUBLIC KEY----- .... -----END PUBLIC KEY-----""" k = KriptaRSA() k.setPublicKey(pub_key) # To encrypt a message encrypted_msg = k.encrypt(k.getPublicKey(), message.encode()) priv_key = """-----BEGIN RSA PRIVATE KEY----- ..... -----END RSA PRIVATE KEY-----""" k.setPrivateKey(priv_key) # To decrypt print(k.decrypt(encrypted_msg).decode()) # secret-message
-
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
kripta-py-0.1.3.tar.gz
(5.5 kB
view details)
Built Distribution
File details
Details for the file kripta-py-0.1.3.tar.gz
.
File metadata
- Download URL: kripta-py-0.1.3.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.14.0-1036-oem
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bfed33c6eae330a0cc44d35b425d2c9659eae8e91095faa11d59579007f61fb |
|
MD5 | a29bee3026cca447f72bd5cb2632f1de |
|
BLAKE2b-256 | 5709813b98ed0ba590f37438cf4d81f3ca68167b26c44f5d50c0cae1d14e4c79 |
File details
Details for the file kripta_py-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: kripta_py-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.14.0-1036-oem
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d62082d33cd7c182a49b9354fde3a4a749e80aaaf3493007b0e01222f4201b2e |
|
MD5 | 7571d658939f6b62794f9b56df10bbcd |
|
BLAKE2b-256 | b7da3195350229275125056a66acbeddf9cd4e755166e05b1e7858d84b8e897c |