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, CryptSH
import random as rnd
# Create key generatore
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_password(password)
# Ex : '469feb93adc2af609a98e6b7cee859bb'
crypt.decrypt_password(encrypt_password)
# 'Hello World !!'
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