Skip to main content

Not an encryption tool

Project description

shift

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.crypt 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

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.0.0.tar.gz (4.4 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: shift-tool-3.0.0.tar.gz
  • Upload date:
  • Size: 4.4 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.0.0.tar.gz
Algorithm Hash digest
SHA256 04d83a3f2a80682ff8d089322551a2163f23f9969a0385b1bafcf0ec5a2f60a3
MD5 03a2895184503ff09307a3d408d18af6
BLAKE2b-256 655803a84ea7fb999c59ba7867052bdebdda1d6c1968b7cac88d2b74945fa161

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