Skip to main content

Not an encryption tool

Project description

shift Tests Installation

Not an encryption tool

Shift was designed to store non-critical text data in such a way that only keyholders could reconstruct a useful message. Following the cryptography community's rule of "Never roll your own encryption", I am specifically not calling this an encryption tool. I have found that through some basic testing, with a reasonable key, breaking this encoding is not easy for the average teenage 1337 haxxor, but I cannot say anything for it's durability against an experienced code breaker. If you find a way to break this, open up an issue, or contact me via email (any pull requests that can strengthen the tool are welcome too).

This tool is still under development, and may not be backwards compatible with itself in the near future.

Installation

To install this tool and library, use PIP:

# Install shift
pip3 install shift-tool

# Run shift
shift2 -h

NOTE: the executable is named shift2 not shift.

Usage

Commandline

Shift's commandline tool has two modes:

# Encode
shift2 /path/to/input/file your_key_here > output.shift

# Decode
shift2 -d /path/to/encoded/file your_key_here > output.txt

Library

You can also integrate shift2 into your own program with the library that is automatically installed with the commandline tool.

import shift2.shcrypt as s2c

# Inputs
my_key = "hello_shift"
my_message = "I'm shifty"

# Generate shifted key
key = s2c.key2shifts(my_key)

# Encode the message
data = s2c.encode(my_message, key)

# Print out the encoded message
print(data)

# To decode, just use s2c.decode instead of s2c.encode

Speed

By using Python's cProfile tool, we can see the time required to encode and decode example.txt. This file contains 50 paragraphs generated by lipsum.com, using the key ewpratten:

Encoding:
         117661 function calls (117578 primitive calls) in 0.065 seconds
Decoding:
         151991 function calls (151904 primitive calls) in 0.092 seconds

To run your own speed tests, use the time.sh script.

Querks

The first interesting thing about shift, is that the key can be randomly modified during encoding. This means that the message and key could actually encode eachother (this was done in my first implementation but produced files >1GB from the word "hello")

Binary data must be b64 encoded before being passed through the encoder due to python safety checking unicode data.

Development

Deploying to PIP

To deploy shift to PIP, use:

pip3 uninstall shift-tool
./deploy.sh
pip3 install --no-cache-dir shift-tool

Running locally

This script must be run with:

python3 -m shift2

NOT

python3 shift2

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

shift-tool-3.1.0.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file shift-tool-3.1.0.tar.gz.

File metadata

  • Download URL: shift-tool-3.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.6.8

File hashes

Hashes for shift-tool-3.1.0.tar.gz
Algorithm Hash digest
SHA256 34efacc3f43c88133cdc35825479a9f8899e55b174b121ee4da64718cd8b57ee
MD5 afd0b7d74609cca2281be03d0e60175b
BLAKE2b-256 3e514dd7e35863b21140b7f13772860e461085dc3b0391dbdb8d1957a4435741

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