Skip to main content

A simple Python data obfuscation utility.

Project description

mystipy

This is an extremely simple command-line utility for obfuscating and deobfuscating data.

Features

  • Data is automatically compressed using gzip.
  • Customizable encryption key (XOR) and salt size.
  • Prompt mode for interactive input.
  • Hexadecimal encoding is used on the output by default, but a --binary override is available.

Installation

The program is a single file, so you can just download/run it manually: python mystipy.py

For the sake of convenience (and to be added to your $PATH), it is also available on PyPI.

pip install --upgrade mystipy

Usage

Basic Commands

  • Obfuscate a file:

    mystipy input_file output_file
    
  • Deobfuscate a file:

    mystipy input_file output_file --reverse
    

Options

  • -p, --prompt: Prompt mode. If provided, you will be prompted for any arguments you don't explicitly set.
  • -r, --reverse: Deobfuscate the input file.
  • -k, --key: XOR key for encryption/deencryption. Must be a valid byte string. (Default: "mystipy")
  • -s, --salt: Number of bytes to use in salt. (Default: 16)
  • --binary: Disable exadecimal encoding/decoding. The data will be (or is) compressed binary data.

Examples

  • Obfuscate a file with a custom key and default settings:

    mystipy myfile.txt obfuscated.myst -k "hunter2"
    
  • Deobfuscate a binary encoded file:

    mystipy obfuscated.myst deobfuscated.txt -r --binary
    
  • Use prompt mode for interactive input:

    mystipy -p
    
  • Use it in your own program:

    import mystipy
    
    # Define your key and data
    key = "hunter2".encode()
    data = b"I would tell you a joke about UDP, but I'm not sure if you'd get it."
    
    # Obfuscate the data
    obfuscated_data = mystipy.obfuscate(data, key)
    print(f"Obfuscated data: {obfuscated_data}")
    
    # Deobfuscate the data
    deobfuscated_data = mystipy.deobfuscate(obfuscated_data, key)
    print(f"Deobfuscated data: {deobfuscated_data.decode()}")
    

Function Aliases

The script includes function aliases to remove ambiguity if you're using it in your own code:

  • mystipy for obfuscate
  • demystipy for deobfuscate
import mystipy
print(mystipy.mystipy == mystipy.obfuscate)       # True
print(mystipy.demystipy == mystipy.deobfuscate)   # True

So if you'd prefer to use the aliases, you'd import the obfuscation/deobfuscation functions like this:

from mystipy import mystipy, demystipy

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

mystipy-0.7.4.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

mystipy-0.7.4-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file mystipy-0.7.4.tar.gz.

File metadata

  • Download URL: mystipy-0.7.4.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for mystipy-0.7.4.tar.gz
Algorithm Hash digest
SHA256 542e7afb547f05c87cdc6e03db86b2eebc5d32a089c57bb6b785377b0ed298ea
MD5 af12ecae0078a939d1e11d5e3c450eed
BLAKE2b-256 29d0e3010ce53dd5ecb14862d3e93ea32ed793928d6c0487f83bcfeacfc02c4b

See more details on using hashes here.

File details

Details for the file mystipy-0.7.4-py3-none-any.whl.

File metadata

  • Download URL: mystipy-0.7.4-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for mystipy-0.7.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2d89dd1853f29fdd0236f3383b072db12e2cb95bc850a1771002ef541cc896c4
MD5 d2f317ba5ea024581d06caa847dca5f5
BLAKE2b-256 efc3225d25a7e57824d63337390e4f016f5dd388eab6c18fe2aa9b6bae69f92c

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