Skip to main content

Python tools for encrypt and decrypt

Project description

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'
output_image = 'output.png'
message = 'Hello World'

# encode image with message
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
original_message = st.decode('output.png', password)

print(original_message) # Hello World

Buy me tanghulu

https://trakteer.id/alfi-syahri

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

cryptid-0.0.3.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cryptid-0.0.3-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file cryptid-0.0.3.tar.gz.

File metadata

  • Download URL: cryptid-0.0.3.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for cryptid-0.0.3.tar.gz
Algorithm Hash digest
SHA256 bb2638ddf0a8a4092b7c2170b86af0b11ebe61e4d5e121a74f2e028465284745
MD5 0f8a286cb665c7ae4752764fcb85c3c2
BLAKE2b-256 cb376f41f88c2d5666c1a5dfcc0f76a67b6e29c8f856da79d75dec0554449ee8

See more details on using hashes here.

File details

Details for the file cryptid-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: cryptid-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for cryptid-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 032b358f58812627d5bba792a2f1ead915b69d5e305b525833caa2659db2ce0a
MD5 39d31844b35bc990045d6849300b5fb8
BLAKE2b-256 8d691ae4ca75c6089aa329226a03476dcde0206044f3f2c6a26ee671705ec68c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page