PyCryptid
PyCryptid is a Python library for encrypt and decrypt object, text, or image
Installation
pip install cryptid
Usage Examples
Cryptid
This class can encrypt most of python object to bytes and decrypt it back to python object (using pickle)
from cryptid import Cryptid
password = 'mykey'
# or generate a new one
password = Cryptid.generate_key()
cryptid = Cryptid(password)
# encrypt and decrypt dict
normal_dict = {'name': 'John Doe', 'age': 20}
enc_dict = cryptid.encrypt(normal_dict)
dec_dict = cryptid.decrypt(enc_dict)
print(enc_dict) # encrypted <class 'bytes'>
print(dec_dict) # {'name': 'John Doe', 'age': 20}
# encrypt and decrypt function
enc_func = cryptid.encrypt(print)
dec_func = cryptid.decrypt(enc_func)
print(enc_func) # encrypted <class 'bytes'>
dec_func('John Doe') # John Doe
Cryptext
Encrypt text using AES
from cryptid import Cryptext
cryptext = Cryptext(password)
text = 'Hello World'
enc_text = cryptext.encrypt(text) # encrypted string
dec_text = cryptext.decrypt(enc_text)
print(dec_text) # Hello World
Steganography
Hide secret message in image
from cryptid import Steganography
st = Steganography()
input_image = '/path/to/image.png'
output_image = 'output.png'
message = 'Hello World'
# encode message to image
st.encode(input_image, message, output_image) # True
# or using password to encrypt the message
st.encode(input_image, message, output_image, password)
# decode message from image
original_message = st.decode('output.png')
# or with password
original_message = st.decode('output.png', password)
print(original_message) # Hello World
AudioSteganography
Hide secret message in audio file
from cryptid import AudioSteganography
ast = AudioSteganography()
input_audio = '/path/to/audio.mp3'
output_audio = 'output.mp3'
message = 'Hello World'
# encode message to audio
ast.encode(input_audio, message, output_audio) # True
# or using password to encrypt the message
ast.encode(input_audio, message, output_audio, password)
# decode message from audio
original_message = ast.decode('output.mp3')
# or with password
original_message = ast.decode('output.mp3', password)
print(original_message) # Hello World
Buy me tanghulu
Metadata
Release files for cryptid 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cryptid-1.0.2.tar.gz | 5.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cryptid-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.6 kB
Release files / cryptid-1.0.2.tar.gz
| Download URL | cryptid-1.0.2.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1de992a118128f2f758c933d6a9604b52c25390bd9e125ec41132e60f6dc5036
|
|
BLAKE2b-256 checksum How to use checksums |
c5f66c9ed7741a1c05c6ae55263eee129c338758431de26babc33cea005762ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Release files / cryptid-1.0.2-py3-none-any.whl
| Download URL | cryptid-1.0.2-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a456711df44c2bef176ff5de3f42bb8d133212b8d030e936dd1b0133a822dde7
|
|
BLAKE2b-256 checksum How to use checksums |
cc35e392d7bd78ef332293a48700dfe113796bdc249180e01aa457d21666cbff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|