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

Uploaded Source

Built Distribution

mystipy-0.7.5-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mystipy-0.7.5.tar.gz
  • Upload date:
  • Size: 6.1 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.5.tar.gz
Algorithm Hash digest
SHA256 ef01fc77aa76faffeefcafdba043b20d27b36b2990d09d3f5906aabf4d299ab4
MD5 828514a7802998a368f2d252b65e1a6e
BLAKE2b-256 e83ef731afdd3d2a3823b71b2ebadaa7d85e84e5ddadb443ae5dc0f0143e416c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mystipy-0.7.5-py3-none-any.whl
  • Upload date:
  • Size: 5.0 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 fd568139169b666bd8a44da63912388ebf369a95efd140945f5fec55a499f415
MD5 42413a8e9fcb227270132d71be612346
BLAKE2b-256 eb3ddc6bd10c095a47333afb8fc8cc952cc90aa15ac0125e4f833ac1bbe85e16

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