Skip to main content

A package that helps encrypt any given string and returns an encrypted string with a signed hash.This data can be sent over the internet and only you will know how to decrypt it because you control the cipher.

Project description

Codacy Badge Downloads PyPI version GitHub Documentation Status Build Status

Mistyfy

A package that helps encrypt any given string and returns an encrypted version of it. This package is very pythonic and has no dependencies. You can expand on it but it gives you the ability to encrypt data in a way only you can understand.

Install

You should download python, any version from 3.6.x will do. This should come with pip and you can use pip install mistyfy to complete the installation.

How to use it

from mistyfy import encode, decode, ciphers, generator
import os
# ciphers is a dictionary containing ascii characters, you can change this at will
# use the generator function to create your own unique cipher
gn = generator(ciphers, -400, 138192812) # first arg is the cipher block, second & third arg is the start and stop counter
secret = b'somesecretkey' # create any secret key, easier if you use os.urandom(n)
# secret = os.urandom(16)
a = "This is a secret message or password"
b = encode(a, secret, gn) 
# output is a dictionary which contains a signed value when decrypting:
# 'eyJtaXN0eWZ5IjogWzQ5Nxxxxxx...
c = decode(b, secret, gn)
# Output:
# This is a secret message or password
# Output: if the secret is wrong
# Failure decrypting data

Use cases

  • Safely store a password or token, validate that it is signed before it can be decoded.
  • Transmit a large set of encrypted strings.
  • Create your own cipher block and be the only one who can decrypt it.

There are other part of the script you can use. To easily create a password checking system use signs and verify_signs function, this takes a similar example given by python doc for hashlib but with the ability to add a secret.

from mistyfy import signs, verify_signs

secrets = 'someimportstuff'
password = 'myverypassword'

encrypt_decrypt = signs(password, secret=secrets)
print(encrypt_decrypt)
# cfe13a4eef4e9c9ccbedf4ec05873ed0
# verify takes into two arguments and 1 required keyword arg to compare if their hashes are the same
# in this situation, the signed data and the actual outcome.                                                                                                                                                                                                  
verify = verify_signs(password, encrypt_decrypt, secret=secrets)
if verify is True:
    print('User is valid')
else:
    print('User is not valid')

# Output
# User is valid

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

mistyfy-2.0.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

mistyfy-2.0.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file mistyfy-2.0.0.tar.gz.

File metadata

  • Download URL: mistyfy-2.0.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.9.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.2

File hashes

Hashes for mistyfy-2.0.0.tar.gz
Algorithm Hash digest
SHA256 5a5b3e9b7076a0018fef3de27fa2ddf709298c704beb9dc091c1fee680c2a6b1
MD5 13f55e36e92cef4cdcf16d601c43c60d
BLAKE2b-256 719f9b3b2473f3e81a6677aaa3e6d36c86d6aaa242d50b04bb06b6dd5cf3fb3d

See more details on using hashes here.

File details

Details for the file mistyfy-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: mistyfy-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.9.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.2

File hashes

Hashes for mistyfy-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c17fa65b6e2fc019ecfd6f6064faef34905208dfe8ca309cbe45c69da66bae55
MD5 733e31dc0165a13989032f69b653c5e6
BLAKE2b-256 f010b91081faa72c14da8eef1ae41fc9c07bf7d5f79261d5690675477aff5fa6

See more details on using hashes here.

Supported by

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