← All Tools Free Browser Sandbox · Pro ZIP + Offline CLI ($5.00) Open Live Tool
Buy on Polar ($5.00)

DevKnife Offline Workbench & Secret-Safe Batch CLI

Zero-upload browser workbench (JWT, JSON/CSV, ReDoS-safe Regex, Diff) paired with a pure-Python batch redaction, NDJSON conversion, and CI diff-gate CLI.

Why this problem wastes time

Every engineering team eventually hits the same quiet security and productivity trap: someone needs to decode a production JWT, flatten an NDJSON export for a stakeholder spreadsheet, or diff two API payloads during an outage. Reaching for a random public web utility means pasting bearer tokens, customer emails, or internal keys into a third-party domain. Even when you use local ad-hoc scripts, four subtle bugs routinely waste hours:

  1. Corrupted UTF-8 JWT decoding in JavaScript: Calling atob() directly on a base64url JWT segment mangles non-ASCII characters (like Nguyễn or emoji) because atob() emits Latin-1 bytes rather than UTF-8 code points. Worse, many quick decoders silently ignore alg: "none" or forget to test nbf (not-before) clock skew.
  2. Dotted-key collisions and leading-zero mangling in JSON-to-CSV: Flattening {"a.b": 1, "a": {"b": 2}} without escaping literal dots overwrites one column silently. Going back from CSV to JSON with naive int() coercion turns zip codes and account IDs like "00123" into 123.
  3. Regex tab freezes and zero-width infinite loops: Testing an untrusted pattern like (a+)+$ live in a browser freezes the tab, while running .exec() in a while loop on .* or ^ spins forever unless lastIndex is explicitly incremented on zero-length matches.
  4. Incident logs that lose correlation after redaction: Replacing every token with "***" scrubs secrets safely, but destroys the ability to tell whether two failing requests used the same expired JWT or two different tokens.

Step-by-step workflow

You can handle deterministic log redaction, UTF-8 JWT inspection, and strict semantic JSON comparisons using only Python's standard library—no pip install required in air-gapped environments or CI runners.

1. Deterministic secret redaction with correlation IDs

By mapping each distinct (secret_type, value) pair to an incremental placeholder like [REDACTED:JWT#1], you keep every secret out of bug reports and LLM prompts while preserving request-to-request correlation:

import re

PATTERNS = [
    ("PEM_KEY", re.compile(r"-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z0-9 ]*PRIVATE KEY-----")),
    ("JWT", re.compile(r"\beyJ[A-Za-z0-9_-]{4,}\.eyJ[A-Za-z0-9_-]{4,}\.[A-Za-z0-9_-]*\b")),
    ("AWS_KEY", re.compile(r"\b(?:AKIA|ASIA)[0-9A-Z]{16}\b")),
]

def scrub_with_correlation(text: str) -> str:
    seen, counters = {}, {}
    for kind, pat in PATTERNS:
        def repl(m, k=kind):
            key = (k, m.group(0).strip())
            if key not in seen:
                counters[k] = counters.get(k, 0) + 1
                seen[key] = f"[REDACTED:{k}#{counters[k]}]"
            return seen[key]
        text = pat.sub(repl, text)
    return text

2. Strict semantic JSON diff in CI without Python's 1 == True trap

In Python, {"flag": 1} == {"flag": True} evaluates to True because bool subclasses int. When comparing API fixtures or configuration snapshots in CI, compare type(a) is type(b) recursively while ignoring volatile fields like meta.request_id or timestamp:

def strict_equal(a, b) -> bool:
    if type(a) is not type(b):
        return False
    if isinstance(a, dict):
        return a.keys() == b.keys() and all(strict_equal(a[k], b[k]) for k in a)
    if isinstance(a, list):
        return len(a) == len(b) and all(strict_equal(x, y) for x, y in zip(a, b))
    return a == b

3. Safe UTF-8 JWT decoding and clock-skew validation

Always decode base64url segments with TextDecoder("utf-8", { fatal: true }) in JavaScript (or base64.urlsafe_b64decode(...).decode("utf-8") in Python), flag alg: "none" case-insensitively, and explicitly remind operators that offline claim inspection never substitutes for cryptographic signature verification with the issuer's public key.

Common pitfalls & edge cases

Automating it in seconds

Open the Free DevKnife Browser Workbench to run all four tools—UTF-8 JWT Inspector, Nested JSON-to-CSV Flattener, ReDoS-Guarded Regex Tester, and Line Diff Viewer—100% locally in your browser with zero uploads.

When you need automated offline pipelines, the $5.00 DevKnife Pro CLI Kit packages devknife.py (zero-dependency Python 3.10+), sample fixtures, and test_devknife.py:

Open Interactive Tool / Demo
DevKnife Offline Workbench & Secret-Safe Batch CLI
Full Bundle / Pro ($5.00) — Offline CLI, source & assets (.zip) · Instant checkout via Polar
Buy on Polar