数据脱敏工具 (mitools-desensitize)
name: mitools-desensitize
by bianchengyy · published 2026-04-01
$ claw add gh:bianchengyy/bianchengyy-mitools-desensitize---
name: mitools-desensitize
description: 数据脱敏工具,支持手机号、身份证、银行卡、邮箱、IP地址、中文姓名等多种敏感信息脱敏
version: 1.0.0
author: WorkBuddy
license: MIT
requires:
- python3
---
# 数据脱敏工具 (mitools-desensitize)
基于正则表达式的数据脱敏工具,支持多种敏感信息类型的自动识别和脱敏处理。
功能特性
使用方法
1. 对文本进行脱敏
脱敏 <文本内容>
示例:
脱敏 张三的手机号是13812345678,邮箱是zhangsan@example.com
2. 对文件进行脱敏
脱敏文件 <文件路径>
示例:
脱敏文件 ./user_data.log
3. 根据映射还原数据
脱敏还原 <脱敏后文本> <映射JSON>
示例:
脱敏还原 "张**的手机号是138*****678" '{"username": {"张三": "demo01"}}'
4. 查看支持的脱敏规则
脱敏规则列表
支持的脱敏规则
| 规则名称 | 说明 | 示例 |
|---------|------|------|
| phone | 手机号脱敏 | 13812345678 → 138*****678 |
| idcard | 身份证号脱敏 | 110101199001011234 → 110******234 |
| bankcard | 银行卡脱敏 | 6222021234567890123 → 62** **** **** **** *** |
| email | 邮箱脱敏 | zhangsan@example.com → zh***@***.com |
| chinese_name | 中文姓名脱敏 | 张三 → 张** |
| ip | IP地址脱敏 | 192.168.1.1 → 139.1.2.100 |
| path_user | 路径用户名脱敏 | /home/zhangsan → /home/demo01 |
| digit_sequence | 长串数字脱敏 | 1234567890 → 0000000001 |
| chinese_field | 字段名脱敏 | 手机号 → 手** |
| wildcard | 通配符规则 | dev*23 → dev31 |
配置文件
工具会自动生成 `desensitize_config.json` 配置文件,包含:
使用场景
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...