analyzing-ransomware-encryption-mechanisms

analyzing-ransomware-encryption-mechanisms is a skill for Claude Code from killvxk/cybersecurity-skills-zh. It costs 102 tokens per session (3,745 once invoked), scanned A, original, Apache-2.0.

A guide to examining how ransomware encrypts files, including its algorithms, key handling, and encryption code. Ransomware is malware that locks data and demands payment.

In plain words
What is it for?
Use it to reverse-engineer ransomware, identify AES, RSA, or ChaCha20 use, test encryption with known file pairs, assess key recovery, and check No More Ransom for available tools.
Why use it?
It helps determine whether implementation weaknesses or an existing free decryptor could allow recovery without paying, while reducing the risk of unsafe recovery attempts.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cybersecurity-skills-zh plugin — 58 skills shipped together

Good fit Use it to reverse-engineer ransomware, identify AES, RSA, or ChaCha20 use, test encryption with known file pairs, assess key recovery, and check No More Ransom for available tools.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/killvxk/cybersecurity-skills-zh/analyzing-ransomware-encryption-mechanisms
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add killvxk/cybersecurity-skills-zh --skill analyzing-ransomware-encryption-mechanisms
Clone the repo
git clone --depth 1 https://github.com/killvxk/cybersecurity-skills-zh

Made for: Claude Code.

Or install cybersecurity-skills-zh, the plugin that ships this one along with the rest of its 58 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for analyzing-ransomware-encryption-mechanisms

README.md
[![agentmods](https://agentmods.dev/badge/skills/killvxk/cybersecurity-skills-zh/analyzing-ransomware-encryption-mechanisms/github.svg)](https://agentmods.dev/skills/killvxk/cybersecurity-skills-zh/analyzing-ransomware-encryption-mechanisms)
Your own site
<a href="https://agentmods.dev/skills/killvxk/cybersecurity-skills-zh/analyzing-ransomware-encryption-mechanisms"><img src="https://agentmods.dev/badge/skills/killvxk/cybersecurity-skills-zh/analyzing-ransomware-encryption-mechanisms/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for analyzing-ransomware-encryption-mechanisms

Your own site · 80×15
<a href="https://agentmods.dev/skills/killvxk/cybersecurity-skills-zh/analyzing-ransomware-encryption-mechanisms"><img src="https://agentmods.dev/badge/skills/killvxk/cybersecurity-skills-zh/analyzing-ransomware-encryption-mechanisms.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,745 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00102 $0.03745
Opus 5 $0.00051 $0.01872
Sonnet 5 $0.00020 $0.00749
Haiku 4.5 $0.00010 $0.00375

Measured 12d ago against content hash 9de8ff064e1d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

analyzing-ransomware-encryption-mechanisms scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/agent.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/analyzing-ransomware-encryption-mechanisms/SKILL.md · 327 lines

How it starts

The opening of the file, as written. The whole thing — 327 lines — stays where its author put it; the contents beside it link to each section on GitHub.

分析勒索软件加密机制

适用场景

  • 发生勒索软件感染,恢复工作需要了解所使用的加密方案
  • 评估无需支付赎金是否可以解密(实现缺陷、已知解密工具)
  • 对勒索软件进行逆向工程,以识别加密算法、密钥派生和密钥存储机制
  • 当发现勒索软件密码实现中的弱点时,开发解密工具
  • 通过加密方式对勒索软件样本进行分类,将其归属到已知家族

不适用于在未事先用加密文件的测试副本验证解密方法的情况下对生产数据进行恢复操作。

前置条件

  • Ghidra 或 IDA Pro,用于对勒索软件二进制文件进行逆向工程
  • Python 3.8+,安装 pycryptodome 库用于测试加密/解密例程
  • 加密文件样本及其对应的明文原件(已知明文对)
  • 访问勒索软件二进制文件(如有必要需先解包)
  • 熟悉对称(AES、ChaCha20)和非对称(RSA)密码算法
  • NoMoreRansom.org 数据库,用于检查是否存在免费解密工具

工作流程

步骤 1:识别加密算法

确定勒索软件使用的密码算法:

# 检查导入表中的 Windows 加密 API
import pefile

pe = pefile.PE("ransomware.exe")

crypto_apis = {
    "CryptAcquireContextA": "Windows CryptoAPI",
    "CryptAcquireContextW": "Windows CryptoAPI",
    "CryptGenKey": "Windows CryptoAPI 密钥生成",
    "CryptEncrypt": "Windows CryptoAPI 加密",
    "CryptImportKey": "Windows CryptoAPI 密钥导入",
    "BCryptOpenAlgorithmProvider": "Windows CNG(现代加密)",
    "BCryptEncrypt": "Windows CNG 加密",
    "BCryptGenerateKeyPair": "Windows CNG 非对称密钥生成",
}

print("加密 API 导入:")
for entry in pe.DIRECTORY_ENTRY_IMPORT:
    for imp in entry.imports:
        if imp.name and imp.name.decode() in crypto_apis:
            print(f"  {entry.dll.decode()} -> {imp.name.decode()}: {crypto_apis[imp.name.decode()]}")
常见勒索软件加密方案:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
AES-256-CBC + RSA-2048:    最常见的混合方案(LockBit、REvil、Conti)
AES-256-CTR + RSA-4096:    流密码模式变体(BlackCat/ALPHV)
ChaCha20 + RSA-4096:       现代流密码(Hive、Royal)
Salsa20 + ECDH:            Curve25519 密钥交换(Babuk)
AES-128-ECB:               弱模式——可能通过已知明文解密
仅 XOR:                    简单加密——始终可恢复
自定义算法:                通常包含实现缺陷

步骤 2:分析密钥生成和管理

逆向工程密钥的生成和存储方式:

勒索软件中的密钥管理模式:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. 强(无密钥则无法恢复):
   - 使用 CryptGenRandom 为每个文件生成 AES 密钥
   - AES 密钥用嵌入的 RSA 公钥加密
   - 加密后的密钥附加到每个文件末尾或单独存储
   - RSA 私钥仅由攻击者的 C2 服务器持有

2. 弱(可能可以恢复):
   - AES 密钥从可预测的种子派生(时间戳、PID)
   - 所有文件使用相同的 AES 密钥(破解一个密钥即可完全恢复)
   - 加密开始前密钥已传输到 C2(PCAP 可能包含密钥)
   - 使用短的重复密钥进行 XOR 加密(可暴力破解)
   - PRNG 以 GetTickCount 或 time() 为种子(密钥空间有限)

3. 存在缺陷的实现:
   - ECB 模式(保留明文模式)
   - 跨文件重用初始化向量(IV)
   - 密钥以明文形式存储在内存中(可从内存转储中恢复)
   - 部分加密(仅加密前 N 字节)

Read the full file on GitHub · 327 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 327 lines · 102 tokens per session scan A 9de8ff064e1d

Subscribe to this mod's changes

analyzing-ransomware-encryption-mechanisms is a skill published in the GitHub repository killvxk/cybersecurity-skills-zh (44 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 102 tokens to every session and 3,745 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

analyzing-ransomware-encryption-mechanisms

Analyzes encryption algorithms, key management, and file encryption routines used by ransomware families to assess decryption feasibility, identify implementation weaknesses, and support recovery efforts. Covers AES, RSA, ChaCha20, and hybrid encryption schemes. Activates for requests involving ransomware…

26zl/cybersec-toolkit · 79 tokens

analyzing-ransomware-encryption-mechanisms

Analyzes encryption algorithms, key management, and file encryption routines used by ransomware families to assess decryption feasibility, identify implementation weaknesses, and support recovery efforts. Covers AES, RSA, ChaCha20, and hybrid encryption schemes. Activates for requests involving ransomware…

Youngmaidainon/Agent-Level-Up · 79 tokens

analyzing-ransomware-encryption-mechanisms

Analyzes encryption algorithms, key management, and file encryption routines used by ransomware families to assess decryption feasibility, identify implementation weaknesses, and support recovery efforts. Covers AES, RSA, ChaCha20, and hybrid encryption schemes. Activates for requests involving ransomware…

pinkpixel-dev/skills-collection-1 · 79 tokens

analyzing-ransomware-encryption-mechanisms

Analyzes encryption algorithms, key management, and file encryption routines used by ransomware families to assess decryption feasibility, identify implementation weaknesses, and support recovery efforts. Covers AES, RSA, ChaCha20, and hybrid encryption schemes. Activates for requests involving ransomware…

marysatasselshaped667/skills-collection-1 · 79 tokens

analyzing-ransomware-encryption-mechanisms

Analyzes encryption algorithms, key management, and file encryption routines used by ransomware families to assess decryption feasibility, identify implementation weaknesses, and support recovery efforts. Covers AES, RSA, ChaCha20, and hybrid encryption schemes. Activates for requests involving ransomware…

autohandai/community-skills · 79 tokens

analyzing-ransomware-encryption-mechanisms

Analyzes encryption algorithms, key management, and file encryption routines used by ransomware families to assess decryption feasibility, identify implementation weaknesses, and support recovery efforts. Covers AES, RSA, ChaCha20, and hybrid encryption schemes. Activates for requests involving ransomware…

Mikaru0Mystic/sectinel · 79 tokens