SH Crypt
A simple symetric encyption decryption algorithm
About
SH Crypt is base on library cryptography algorithm and use more specifically the Electronic Code Book (ECB) for symetric encryption and decryption.
Here are some code example to use the library.
Generate a key, encrypt and decrypt text
from sh_crypt import GenKeySH, SymCryptSH, AsymCryptSH
import random as rnd
###############################
## Symetric Cipher
# Create key generator
seed = rnd.randint(1, 1e12)
key_gen = GenKeySH(seed)
key = key_gen.gen_sym_key(path_store="mykey.txt")
# Ex : 'e169344ae15719669ed2fecea1ac4773'
password = "Hello World !!"
crypt = CryptSH(key)
encrypt_password = crypt.encrypt_message(password)
# Ex : '469feb93adc2af609a98e6b7cee859bb'
crypt.decrypt_message(encrypt_password)
# 'Hello World !!'
###############################
## Asymetric Cipher
key_gen = GenKeySH()
priv_key, public_key = key_gen.gen_asym_key()
# We can store the key with parameters path_store="file_path".
crypt = AsymCryptSH()
crypt.add_key(priv_key)
crypt.add_key(public_key)
message = "Hello World !!!"
# Encrypt / Decrypt Message
message_enc = crypt.encrypt_message(message)
crypt.decrypt_message(message_enc)
# Sign message / check signature
signature = crypt.sign_message(message)
if crypt.check_sign_message(signature, message):
print("Signature is valid")
else:
print("Signature is invalid")
As you can see in the example, you can store your generated key in a text file and reuse it later, with the path_store argument.
Install
You can install sh-crypt with pip:
pip install sh-crypt
or download the sh-crypt source, choose your version, and install with the command:
python setup.py install
Metadata
Release files for sh-crypt 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sh-crypt-1.2.1.tar.gz | 6.0 kB | Without provenance | Details for sh-crypt-1.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sh_crypt-1.2.1-py3-none-any.whl | Python 3 | none | any | Details for sh_crypt-1.2.1-py3-none-any.whl |
Total release size: 12.7 kB
Release files / sh-crypt-1.2.1.tar.gz
| Download URL | sh-crypt-1.2.1.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4abf43d5a7759af7f73d267649b75d0376c0b8cd97cde6356796e00cb5bdca7
|
|
BLAKE2b-256 checksum How to use checksums |
6e9b392471265936e03fd3f1eb7c652940e12c087aba8b059638440cbbad7d84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.14
|
Release files / sh_crypt-1.2.1-py3-none-any.whl
| Download URL | sh_crypt-1.2.1-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a832f90e6942f37787bcf8f5acf5767267e1e1fe9778f4722605441fdafc82be
|
|
BLAKE2b-256 checksum How to use checksums |
588e7e0b88c9f9b32d80049ca97e5ec039f9660cee788441ed3d1e9682971154
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.14
|
Security for sh-crypt 1.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.