Simple crypto library
Project description
py-jccrypto
To install
pip install jccrypto
Sample code
from jccrypto import JcCrypto
text = "Pythonの暗号化ライブラリとそれらの概要を表にまとめました。非常にたくさんのライブラリがあることがわかりました。それぞれのライブラリが得手不得手を持っているためユースケースに応じて適切なライブラリを使用する必要があります。"
# 鍵の生成
key = 'abcdefghijklmnop'.encode()
# IVの生成
iv = '1234567890123456'.encode()
cr = JcCrypto(key, iv)
print("")
encoded = cr.encode_text(text)
print("encoded={}".format(encoded))
decoded = cr.decode_text(encoded)
print("decoded={}".format(decoded))
print("")
text_bytes = text.encode()
print("text_bytes={}".format(text_bytes))
print("")
encoded = cr.encode_bytes(text_bytes)
print("encoded={}".format(encoded))
decoded = cr.decode_bytes(encoded)
print("decoded={}".format(decoded))
print("")
text2 = decoded.decode()
print("text2={}".format(text2))
print("")
list = [11, 22, 33]
encoded = cr.encode_pickle(list)
decoded = cr.decode_pickle(encoded)
print("decoded={}".format(decoded))
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.