Metadata-Version: 2.4
Name: encutil
Version: 0.1.0
Summary: Encoding/Decoding Utility CLI - base64, hex, URL, HTML, hashing, JWT decoding
Author-email: Marcus <marcus.builds.things@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/marcusbuildsthings-droid/encutil
Project-URL: Repository, https://github.com/marcusbuildsthings-droid/encutil
Project-URL: Issues, https://github.com/marcusbuildsthings-droid/encutil/issues
Keywords: cli,encoding,decoding,base64,hex,hash,jwt,url
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Utilities
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.0.0
Dynamic: license-file

# encutil

Encoding/Decoding Utility CLI - encode and decode base64, hex, URL, HTML entities, hash strings/files, and decode JWTs.

## Installation

```bash
pip install encutil
```

## Usage

All commands accept input as an argument, from `-f FILE`, or from stdin.

### Base64

```bash
encutil b64e "hello world"           # SGVsbG8gV29ybGQ=
encutil b64d "SGVsbG8gV29ybGQ="       # hello world
echo "secret" | encutil b64e         # c2VjcmV0Cg==
```

### Hex

```bash
encutil hex "hello"                  # 68656c6c6f
encutil unhex "68656c6c6f"           # hello
```

### URL Encoding

```bash
encutil url "hello world"            # hello%20world
encutil unurl "hello%20world"        # hello world
encutil url "key=value&foo=bar"      # key%3Dvalue%26foo%3Dbar
```

### HTML Entities

```bash
encutil html "<script>alert('xss')</script>"
# &lt;script&gt;alert(&#x27;xss&#x27;)&lt;/script&gt;

encutil unhtml "&lt;script&gt;"      # <script>
```

### Hashing

```bash
encutil hash sha256 "password"       # 5e884898da28...
encutil hash md5 "text"              # 1cb251ec0d56...
encutil hashfile sha256 myfile.txt   # Hash a file
```

Supported algorithms: `md5`, `sha1`, `sha256`, `sha512`, `sha224`, `sha384`

### JWT Decoding

Decode JWT tokens without verification (extracts header and payload):

```bash
encutil jwt "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"

# Header:
# {
#   "alg": "HS256",
#   "typ": "JWT"
# }
#
# Payload:
# {
#   "sub": "1234567890",
#   "name": "John Doe",
#   "iat": 1516239022
# }
```

### Auto-Detect Encoding

Try multiple decodings and show what works:

```bash
encutil detect "SGVsbG8gV29ybGQ="

# BASE64:
# Hello World
```

### JSON Output

All commands support `--json` for machine-readable output:

```bash
encutil b64e "hello" --json          # {"base64": "aGVsbG8="}
encutil hash sha256 "test" --json    # {"algorithm": "sha256", "hash": "9f86d08..."}
```

### File Input

Read from file with `-f`:

```bash
encutil b64e -f secret.txt
encutil hashfile sha256 myfile.bin
```

## For AI Agents

See [SKILL.md](SKILL.md) for AI-agent-friendly documentation.

## License

MIT
