Re crypto decrypt

From dslsdzc/rev-skills · View interactive version

Re crypto decrypt is an AI agent skill from the GitHub repository dslsdzc/rev-skills. 加密数据还原:定位解密函数、写解密脚本。 触发词:解密、decrypt、还原数据、解密流量

How to use this skill

Skill file

加密数据还原

何时使用 / 何时不用

工具准备

所有工具先验证再使用。本技能处理的是转储/反编译产物与密文数据,运行样本环节在 [[re-sandbox]] 内([[re-analyze/platform-tips]] 最高原则)。

python3 + pycryptodome —— 解密脚本主力

目标程序转储/反编译产物 —— 还原算法的依据

angr(可选)—— 符号执行补足难还原的逻辑

操作步骤

按顺序执行,每步记下结果。前提:算法([[re-crypto-id]])与密钥([[re-crypto-keys]])已确认或至少有一方候选;脚本与验证结果(明文样本 + sha256)存档供报告引用。

  1. 证伪"密文":先定位真实密文边界(跳过此步是加密分析最常见的失败方式):
  1. 定位解密函数(交叉引用密文输入点):
  1. 反编译还原算法:
  1. 重写为独立脚本(python):

```python

# decrypt.py —— 按反编译还原的算法重写

from Crypto.Cipher import AES

import sys

key = bytes.fromhex("...") # 来自 [[re-crypto-keys]] 步骤 1/2/5

iv = key[:16] # 样本实现: IV = key 前 16 字节

data = open(sys.argv[1], 'rb').read()

pt = AES.new(key, AES.MODE_CBC, iv).decrypt(data)

print(pt) # 或写文件 + 后续校验

```

  1. 用已知明文验证:
  1. 流量场景:解出明文流量流:

```sh

tshark -r c2.pcap -Y 'tcp.payload' -T fields -e data.data | sed 's/://g' | xxd -r -p > payloads.bin

```

跨域联合

常见坑与陷阱

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.