cognis-digital/cipherdetect

GitHub: cognis-digital/cipherdetect

一个基于语言评分机制的古典密码检测与自动破解工具,支持 CI 集成和 AI agent 调用。

Stars: 0 | Forks: 0

CIPHERDETECT # CIPHERDETECT ### 通过评分检测并破解古典密码 (caesar/vigenere/xor) [![PyPI](https://img.shields.io/pypi/v/cognis-cipherdetect.svg?color=6b46c1)](https://pypi.org/project/cognis-cipherdetect/) [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/e0cd829b7a072947.svg)](https://github.com/cognis-digital/cipherdetect/actions) [![License: COCL 1.0](https://img.shields.io/badge/License-COCL%201.0-2b6cb0.svg)](LICENSE) [![Suite](https://img.shields.io/badge/Cognis-Neural%20Suite-6b46c1.svg)](https://github.com/cognis-digital) *Cognis Neural Suite 的一部分。*
``` pip install cognis-cipherdetect cipherdetect scan . # → prioritized findings in seconds ``` ## 用法 — 分步指南 1. **安装:** pip install -e . 2. **破解密文文件**,使用 `crack` 子命令 — 它会根据置信度对候选解密结果(Caesar、Vigenère 等)进行排名: cipherdetect crack secret.txt 或者使用 `--text` 直接传入内联密文: cipherdetect crack --text "Khoor Zruog" 3. **调整搜索**,使用 `--top`(显示的候选结果数量,默认为 5)和 `--max-key-len`(测试的最大 Vigenère 密钥长度,默认为 12): cipherdetect crack secret.txt --top 10 --max-key-len 16 4. **查看结果。** 表格会根据 `CIPHER`、`SEV`、`SCORE`、`KEY` 和恢复的 `PLAINTEXT` 对候选结果进行排名。使用 `--format json` 进行管道传输,或使用 `--format html -o report.html` 生成可共享的报告。退出码:**2 = 找到了确信的解密结果**(分数高于基准线),**0 = 无确信结果**,**1 = 错误/用法不当**。 cipherdetect crack secret.txt --format json 5. **在 CI / 分类排查中使用** — 在弱/古典加密极易被破解时予以暴露: cipherdetect crack secret.txt --format json if [ $? -eq 2 ]; then echo "Ciphertext was cracked — weak cipher"; fi ## 目录 - [为什么选择 cipherdetect?](#why) · [功能](#features) · [快速开始](#quick-start) · [示例](#example) · [架构](#architecture) · [AI 技术栈](#ai-stack) · [对比分析](#how-it-compares) · [集成](#integrations) · [在任何地方安装](#install-anywhere) · [相关项目](#related) · [贡献指南](#contributing) ## 为什么选择 cipherdetect? 通过评分检测并破解古典密码 (caesar/vigenere/xor) — 无需搭建重量级基础设施。 `cipherdetect` 具备单一用途、可脚本化且支持自托管:将其指向目标,以您工作流已有的格式(table · JSON · SARIF)获取优先级排序的结果,以此为 CI 设置门禁,并让 agent 通过 MCP 驱动它。
↑ 回到顶部
## 功能 - ✅ 英语评分 - ✅ 破解 Caesar - ✅ 破解 Vigenere - ✅ 破解 Xor - ✅ 分析 - ✅ 支持 Linux/macOS/Windows · Docker · devcontainer 运行 - ✅ 提供 Python、JavaScript、Go 和 Rust 端口 (`ports/`)
↑ 回到顶部
## 快速开始 ``` pip install cognis-cipherdetect cipherdetect --version cipherdetect scan . # scan current project cipherdetect scan . --format json # machine-readable cipherdetect scan . --fail-on high # CI gate (non-zero exit) ```
↑ 回到顶部
## 示例 ``` $ cipherdetect scan . [HIGH ] CIP-001 example finding (./src/app.py) [MEDIUM ] CIP-002 another signal (./config.yaml) 2 findings · risk score 5 · 38ms ```
↑ 回到顶部
## 架构 ``` flowchart LR IN[input] --> P[cipherdetect
analyze + score] P --> OUT[report] ```
↑ 回到顶部
## 从任何 AI 技术栈中使用 `cipherdetect` 可与每一种流行的 AI 使用方式互操作: - **MCP server** — `cipherdetect mcp` (Claude Desktop、Cursor、Cognis.Studio、[uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet)) - **兼容 OpenAI / JSON** — 将 `cipherdetect scan . --format json` 通过管道传递给任何 agent 或 LLM - **LangChain · CrewAI · AutoGen · LlamaIndex** — 一行代码即可将 CLI/JSON 封装为工具 - **CI / 脚本** — 退出码 + SARIF,适用于非 AI 管道
↑ 回到顶部
## 对比分析 | | **Cognis cipherdetect** | 典型工具 | |---|:---:|:---:| | 可自托管,无需账户 | ✅ | 视情况而定 | | 单条命令,零配置 | ✅ | ⚠️ | | 支持 CI 的 JSON + SARIF | ✅ | 视情况而定 | | MCP 原生 (AI agent) | ✅ | ❌ | | 多语言端口 (JS/Go/Rust) | ✅ | ❌ | | 开源许可 | ✅ COCL | 视情况而定 |
↑ 回到顶部
## 集成 可接入您的技术栈:用于代码扫描的 **SARIF**,适用于任何场景的 **JSON**,用于 AI agent 的 **MCP server** (`cipherdetect mcp`),以及用于 SIEM/Slack/Jira 的 webhook 转发器。参见 [`docs/INTEGRATIONS.md`](docs/INTEGRATIONS.md)。
↑ 回到顶部
## 安装 — 全平台,全方式 ``` pip install "git+https://github.com/cognis-digital/cipherdetect.git" # pip (works today) pipx install "git+https://github.com/cognis-digital/cipherdetect.git" # isolated CLI uv tool install "git+https://github.com/cognis-digital/cipherdetect.git" # uv pip install cognis-cipherdetect # PyPI (when published) docker run --rm ghcr.io/cognis-digital/cipherdetect:latest --help # Docker brew install cognis-digital/tap/cipherdetect # Homebrew tap curl -fsSL https://raw.githubusercontent.com/cognis-digital/cipherdetect/main/install.sh | sh ``` | Linux | macOS | Windows | Docker | Cloud | |---|---|---|---|---| | `scripts/setup-linux.sh` | `scripts/setup-macos.sh` | `scripts/setup-windows.ps1` | `docker run ghcr.io/cognis-digital/cipherdetect` | [DEPLOY.md](docs/DEPLOY.md) (AWS/Azure/GCP/k8s) |
↑ 回到顶部
## 相关的 Cognis 工具 **探索套件 →** [🗂️ 全部 170+ 工具](https://github.com/cognis-digital/cognis-neural-suite) · [⭐ awesome-cognis](https://github.com/cognis-digital/awesome-cognis) · [🔗 cognis-sources](https://github.com/cognis-digital/cognis-sources) · [🤖 uncensored-fleet](https://github.com/cognis-digital/uncensored-fleet) · [🧠 engram](https://github.com/cognis-digital/engram)
↑ 回到顶部
## 互操作性 `{}` 与包含 300+ 工具的 Cognis 套件协同工作 — JSON 输入/输出以及共享的 兼容 OpenAI 的 `/v1` 主干网络。参见 **[INTEROP.md](INTEROP.md)** 了解 套件图谱、组合模式和参考技术栈。 ## 许可证 在 **Cognis Open Collaboration License (COCL) v1.0** 下提供源代码 — 可免费用于个人、内部评估、研究和教育用途;**商业/生产用途需要许可证** (licensing@cognis.digital)。参见 [LICENSE](LICENSE)。
Cognis Digital · Cognis Neural Suite 中 170+ 工具之一 · 让明天在今天更美好
标签:DNS 反向解析, Python, 加密解密, 古典密码, 可视化界面, 密码学, 手动系统调用, 数据可视化, 无后门, 日志审计, 请求拦截, 逆向工具