Skip to main content

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 string 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

Metadata

Release files for mistyfy 2.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mistyfy 2.0.6
File Size Uploaded
mistyfy-2.0.6.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mistyfy 2.0.6
File Interpreter ABI Platform
mistyfy-2.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 20.7 kB

Release files / mistyfy-2.0.6.tar.gz

Download URL mistyfy-2.0.6.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
88012bdbcff66ed636dbd4f106547ca82320a30b623f0004dc6c9542e4c74f36
BLAKE2b-256 checksum
How to use checksums
18b69efc0f96f2dc33d1327bfef1ebd6547c68d76db6d3b1d12c442de4d2e491
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / mistyfy-2.0.6-py3-none-any.whl

Download URL mistyfy-2.0.6-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7566f0b09e6231ce58793e13ac475fcb0eb35c0d20e3179a5b89adf1a2d31c71
BLAKE2b-256 checksum
How to use checksums
2f173da7385bef7432f0b30fba81124205afae3b83120e3fba67a08ef220fe08
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

2.0.6 This release

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page