Data Masking: Locally Replacing Numbers in Texts and Documents Before External Transmission

Preface

Before handing reports, tables, or conversation snippets to LLMs or external collaborators, it is often necessary to first process real numbers such as revenue, user counts, or ID numbers. Manual find-and-replace is prone to missing items, and the same value might be altered inconsistently across different locations. Furthermore, if an internal “reversible” mapping needs to be maintained, the workflow becomes even more tedious.

Here we introduce the SkillHub community skill “Data Masking” (@user_dc99567a/data-mask). It performs number recognition and replacement locally, supports multiple masking strategies, and allows for data restoration using a mapping table in hash mapping scenarios.

What is this

“Data Masking” is an Agent Skill listed on SkillHub by the publisher user_dc99567a, with coordinates @user_dc99567a/data-mask. The current version is 1.0.4, categorized under office-efficiency, with a community source. The page indicates requires_api_key=false, meaning no additional API Key is required.

Its positioning can be summarized as: performing batch masking of numbers appearing in text or documents, with processing completed locally. It supports various formats including Word, Excel, PDF, and images (using built-in OCR to recognize numbers in images), and offers multiple strategies such as hash mapping and fuzzing, as well as support for restoring masked data.

Core Features

Four Masking Strategies

If no strategy is specified in the conversation, the skill defaults to Hash Mapping; other strategies can be attempted later to compare effects.

  1. Hash Mapping (Default): e.g., 123456 → 59497. The same value maps to a consistent result, supporting restoration via a mapping table. This is the preferred choice for most business scenarios.
  2. Placeholder: e.g., 123456 → [A], 789 → [B]. The numbers are completely hidden when sent to LLMs.
  3. Fuzzing: e.g., 123456 → 125000. Preserves the order of magnitude, providing some reference value after masking.
  4. Range Replacement: e.g., 123456 → [86419~160492]. Only expresses a range of magnitude without retaining the precise value.

Text and Files

  • Can directly mask numbers in pasted paragraphs or conversations.
  • Can mask files; in the official example, sample_report.txt generates sample_report_masked.txt after processing.
  • regarding formats, official documentation covers Word, Excel, PDF, images, etc.; image paths rely on built-in OCR to extract numbers before masking.

Installation and Activation

The installation method provided on the SkillHub page instructs the AI to pull the skill according to the unified installation documentation:

Please install `@user_dc99567a/data-mask` based on https://skillhub.cn/install/skillhub.md.

In clients supporting the SkillHub skill protocol (such as Cursor, Codex CLI, Claude Code), simply send the above instruction to the Agent; specific directories and refresh methods for each client are subject to skillhub.md. This skill does not require API Key configuration.

Typical Usage

The following examples are from the official SkillHub documentation and can be reproduced directly in conversation.

1. Default Hash Mapping (Paragraph Masking)

Input:

Help me mask this text: This year's revenue was 887.18 million yuan, a year-on-year increase of 99%, user count reached 68.45 million, and net profit was 2.51 million yuan.

Example Output:

This year's revenue was 746.43 million yuan, a year-on-year increase of 22%, user count reached 82.52 million, and net profit was 3.88 million yuan.

2. Specify Placeholder Strategy

Input:

Help me mask this text using the placeholder strategy: This year's revenue was 887.18 million yuan, a year-on-year increase of 99%, user count reached 68.45 million, and net profit was 2.51 million yuan.

Example Output:

This year's revenue was [A], a year-on-year increase of [B], user count reached [C], and net profit was [D].

3. File Masking

Input:

Mask the file: sample_report.txt

Expected Result: A masked text file sample_report_masked.txt.

Common natural language intents also include: “Fuzz sensitive data in the report,” “Mask and send to LLM,” “Replace numbers in tables or Word/PDF documents,” “Batch process multiple files in a directory,” etc.; the Agent will select the plain text, table, or document processing workflow based on the skill’s internal routing. If restoration of real values is required, Hash Mapping should be used during masking to retain the mapping relationship generated by the skill, and then restoration (unmask) should be executed according to the skill’s instructions.

Scenarios and Notes

Target Audience

  • Teams that need to submit documents, tables, or screenshots containing numbers to external parties or LLMs but do not want to expose original values.
  • Scenarios requiring local masking with the occasional need to restore hash mapping results to real data.
  • Users needing to switch strategies based on context: using Placeholders for complete external hiding, Fuzzing or Ranges for magnitude preservation, and Hash Mapping for internal traceability.

Usage Notes

  • The masking granularity focuses on “numbers”; non-numeric sensitive information (names, addresses, etc.) is not covered by the official description and requires self-evaluation or other methods.
  • For scanned PDFs, complex layouts, or unknown formats, actual performance depends on parsing and OCR quality; if the output is a text file, the layout may differ from the original file.
  • Strategies like Placeholder, Fuzzing, and Range replacement usually cannot be fully restored like Hash Mapping. Strategies should be selected before sharing, and mapping tables should be retained if restoration is needed.
  • When handling highly sensitive data, organizational data classification and compliance processes should still be followed in addition to skill masking.

Conclusion

“Data Masking” consolidates local number replacement, multi-strategy selection, and document/image format support into a single Skill. It is suitable for triggering via natural language in Agent conversations, reducing the risk of manual replacement and missing items.

  • SkillHub Page: https://www.skillhub.cn/skills/user_dc99567a/data-mask
  • API Coordinates Page: https://api.skillhub.cn/user_dc99567a/data-mask
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye