Skip to content

Karasukaigan/FunSigner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FunSigner

logo

A tool for embedding hidden text signatures into Funscript JSON files.

The signature is stored by adjusting the parity (odd or even) of each at and pos value via its least significant bit. BCH forward error correction, block interleaving, and redundant embedding are used to improve recovery after common modifications.

How It Works

FunSigner stores a text signature inside a Funscript JSON file by making small changes to the numeric values in the at and pos arrays.

Encoding

  1. Combine the input text with length and checksum information.
  2. Pad the data and encode it with BCH forward error correction.
  3. Block-interleave the encoded data to reduce the impact of localized modifications.
  4. Embed the resulting bitstream into both the at and pos arrays by adjusting the parity of each numeric value.

Decoding

  1. Parse the JSON and extract the parity bit from each at and pos value.
  2. Recover the embedded bitstream from the at and/or pos arrays.
  3. Reverse the interleaving and decode the BCH codewords.
  4. Verify the recovered data and extract the embedded text.

Design Goals

FunSigner is designed to:

  • Embed a short text signature inside a Funscript file.
  • Keep modifications to the script as small as possible.
  • Allow signatures to survive common editing operations.
  • Provide a simple way to associate a script with its author.

It is not intended to provide cryptographic authentication or prevent deliberate removal of the embedded signature.

Robustness and Limitations

FunSigner is a signature and copyright declaration tool, not a cryptographic security mechanism.

Designed to tolerate

  • Small changes to numeric values
  • Overall timestamp shifts
  • Appending actions to the script

Known limitations

  • Not suitable for very short scripts.
  • The embedded signature can be overwritten or intentionally removed.
  • Large-scale editing or rewriting of the script may destroy the embedded signature.

Open Source Components

The following components are released under the MIT License:

Path Description
cli.py Command-line interface
src/ BCH encoder/decoder, interleaver, JSON processing
python/funsigner.py Single-file Python module
javascript/funsigner.js UMD module for browsers and Node.js

Quick Start

CLI (from source)

python cli.py -t "my signature" input.funscript
python cli.py -m d input_signed.funscript

Python Module

The reusable module lives at python/funsigner.py — a single file with zero external dependencies. Copy it into any project and import directly:

import funsigner

signed = funsigner.sign(json_text, "my signature")
extracted = funsigner.decrypt(signed)
API Description
sign(json_text: str, text: str) -> str Embed text into the JSON string, return a new signed JSON string
decrypt(json_text: str) -> str | None Extract hidden text from a signed JSON string, or None if not found
  • Only requires Python's standard json module
  • Input must be valid JSON with an actions array containing at/pos numeric fields
  • Non-ASCII characters in the signature text are automatically replaced with ?

JavaScript

The library javascript/funsigner.js is a UMD (Universal Module Definition) module — works in browsers, Node.js, and AMD loaders without any dependencies.

Browser (script tag):

<script src="funsigner.js"></script>
<script>
  var signed = funsigner.sign(jsonText, "my signature");
  var extracted = funsigner.decrypt(signed);
</script>

Node.js / CommonJS:

var funsigner = require('./funsigner.js');
var signed = funsigner.sign(jsonText, "my signature");
var extracted = funsigner.decrypt(signed);
API Description
funsigner.sign(jsonText, text) Embed text into the JSON string, return a new signed JSON string
funsigner.decrypt(jsonText) Extract hidden text from a signed JSON string, or null if not found

Support Development

FunSigner is open source and free to use. If you find it useful, consider purchasing the pre-built executables to support ongoing development.

funsigner.exe (CLI) and funsigner_gui_v1.0.0.exe (GUI) are ready-to-run Windows tools — no Python environment required. Just download, unzip, and use them directly from any command prompt or integrate them into your workflow.

License

This project is licensed under the MIT License.

About

A tool for signing and copyright declaration of Funscript files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors