analyzing-ransomware-encryption-mechanisms
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAnalyzing Ransomware Encryption Mechanisms
勒索软件加密机制分析
When to Use
使用场景
- A ransomware infection has occurred and recovery requires understanding the encryption scheme used
- Assessing whether decryption is possible without paying the ransom (implementation flaws, known decryptors)
- Reverse engineering ransomware to identify the encryption algorithm, key derivation, and key storage mechanism
- Developing a decryptor tool when a weakness in the ransomware's cryptographic implementation is identified
- Classifying a ransomware sample by its encryption approach to attribute it to a known family
Do not use for production data recovery operations without first verifying the decryption method on test copies of encrypted files.
- 发生勒索软件感染,恢复工作需要了解所使用的加密方案
- 评估无需支付赎金即可解密的可能性(实现缺陷、已知解密工具)
- 逆向工程勒索软件以识别加密算法、密钥派生和密钥存储机制
- 当发现勒索软件加密实现存在弱点时,开发解密工具
- 通过加密方法对勒索软件样本进行分类,以归属到已知家族
注意:在未先在加密文件的测试副本上验证解密方法之前,请勿用于生产数据恢复操作。
Prerequisites
前提条件
- Ghidra or IDA Pro for reverse engineering the ransomware binary
- Python 3.8+ with library for testing encryption/decryption routines
pycryptodome - Sample encrypted files and their corresponding plaintext originals (known-plaintext pairs)
- Access to the ransomware binary (unpacked if applicable)
- Familiarity with symmetric (AES, ChaCha20) and asymmetric (RSA) cryptographic algorithms
- NoMoreRansom.org database for checking existing free decryptors
- 用于逆向工程勒索软件二进制文件的Ghidra或IDA Pro
- 安装库的Python 3.8+,用于测试加密/解密例程
pycryptodome - 加密文件样本及其对应的明文原始文件(已知明文对)
- 勒索软件二进制文件的访问权限(如有需要需先脱壳)
- 熟悉对称(AES、ChaCha20)和非对称(RSA)加密算法
- NoMoreRansom.org数据库,用于查询现有免费解密工具
Workflow
工作流程
Step 1: Identify the Encryption Algorithm
步骤1:识别加密算法
Determine which cryptographic algorithm the ransomware uses:
python
undefined确定勒索软件使用的加密算法:
python
undefinedCheck for Windows Crypto API usage in imports
检查导入中的Windows Crypto API使用情况
import pefile
pe = pefile.PE("ransomware.exe")
crypto_apis = {
"CryptAcquireContextA": "Windows CryptoAPI",
"CryptAcquireContextW": "Windows CryptoAPI",
"CryptGenKey": "Windows CryptoAPI key generation",
"CryptEncrypt": "Windows CryptoAPI encryption",
"CryptImportKey": "Windows CryptoAPI key import",
"BCryptOpenAlgorithmProvider": "Windows CNG (modern crypto)",
"BCryptEncrypt": "Windows CNG encryption",
"BCryptGenerateKeyPair": "Windows CNG asymmetric key gen",
}
print("Crypto API Imports:")
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()]}")
undefinedCommon Ransomware Encryption Schemes:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
AES-256-CBC + RSA-2048: Most common hybrid scheme (LockBit, REvil, Conti)
AES-256-CTR + RSA-4096: Stream cipher mode variant (BlackCat/ALPHV)
ChaCha20 + RSA-4096: Modern stream cipher (Hive, Royal)
Salsa20 + ECDH: Curve25519 key exchange (Babuk)
AES-128-ECB: Weak mode - potential decryption via known-plaintext
XOR-only: Trivial encryption - always recoverable
Custom algorithm: Often contains implementation flaws
undefinedimport 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()]}")
undefined常见勒索软件加密方案:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
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加密: 简易加密 - 始终可恢复
自定义算法: 通常存在实现缺陷
undefinedStep 2: Analyze Key Generation and Management
步骤2:分析密钥生成与管理
Reverse engineer how encryption keys are generated and stored:
Key Management Patterns in Ransomware:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. STRONG (no recovery possible without key):
- Per-file AES key generated with CryptGenRandom
- AES key encrypted with embedded RSA public key
- Encrypted key appended to each file or stored separately
- RSA private key held only by attacker's C2 server
2. WEAK (potential recovery):
- AES key derived from predictable seed (timestamp, PID)
- Same AES key used for all files (single key compromise = full recovery)
- Key transmitted to C2 before encryption starts (PCAP may contain key)
- XOR with short repeating key (brute-forceable)
- PRNG seeded with GetTickCount or time() (limited keyspace)
3. FLAWED IMPLEMENTATION:
- ECB mode (preserves plaintext patterns)
- Initialization vector (IV) reuse across files
- Key stored in plaintext in memory (recoverable from memory dump)
- Partial encryption (only first N bytes encrypted)逆向工程加密密钥的生成和存储方式:
勒索软件中的密钥管理模式:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. 强安全性(无密钥则无法恢复):
- 使用CryptGenRandom生成每个文件的AES密钥
- AES密钥使用嵌入的RSA公钥加密
- 加密后的密钥附加到每个文件或单独存储
- RSA私钥仅由攻击者的C2服务器持有
2. 弱安全性(可能恢复):
- AES密钥由可预测的种子(时间戳、PID)派生
- 所有文件使用相同的AES密钥(单个密钥泄露=完全恢复)
- 加密开始前密钥传输到C2(PCAP可能包含密钥)
- 使用短重复密钥进行XOR加密(可暴力破解)
- PRNG使用GetTickCount或time()作为种子(密钥空间有限)
3. 实现缺陷:
- ECB模式(保留明文模式)
- 跨文件重复使用初始化向量(IV)
- 密钥以明文形式存储在内存中(可从内存转储中恢复)
- 部分加密(仅加密前N字节)Step 3: Examine File Encryption Routine
步骤3:检查文件加密例程
Reverse engineer the file processing logic:
c
// Typical ransomware file encryption flow (decompiled pseudo-code from Ghidra):
void encrypt_file(char *filepath) {
// 1. Check file extension against target list
if (!is_target_extension(filepath)) return;
// 2. Generate per-file AES key (32 bytes for AES-256)
BYTE aes_key[32];
CryptGenRandom(hProv, 32, aes_key);
// 3. Generate random IV (16 bytes)
BYTE iv[16];
CryptGenRandom(hProv, 16, iv);
// 4. Read file contents
HANDLE hFile = CreateFile(filepath, GENERIC_READ, ...);
BYTE *plaintext = read_entire_file(hFile);
// 5. Encrypt with AES-256-CBC
aes_cbc_encrypt(plaintext, file_size, aes_key, iv);
// 6. Encrypt AES key with RSA public key
BYTE encrypted_key[256]; // RSA-2048 output
rsa_encrypt(aes_key, 32, rsa_pubkey, encrypted_key);
// 7. Write: encrypted_data + encrypted_key + IV to file
write_file(filepath, encrypted_data, encrypted_key, iv);
// 8. Rename file with ransomware extension
rename_file(filepath, strcat(filepath, ".locked"));
}逆向工程文件处理逻辑:
c
// 典型勒索软件文件加密流程(来自Ghidra的反编译伪代码):
void encrypt_file(char *filepath) {
// 1. 检查文件扩展名是否在目标列表中
if (!is_target_extension(filepath)) return;
// 2. 生成每个文件的AES密钥(AES-256为32字节)
BYTE aes_key[32];
CryptGenRandom(hProv, 32, aes_key);
// 3. 生成随机IV(16字节)
BYTE iv[16];
CryptGenRandom(hProv, 16, iv);
// 4. 读取文件内容
HANDLE hFile = CreateFile(filepath, GENERIC_READ, ...);
BYTE *plaintext = read_entire_file(hFile);
// 5. 使用AES-256-CBC加密
aes_cbc_encrypt(plaintext, file_size, aes_key, iv);
// 6. 使用RSA公钥加密AES密钥
BYTE encrypted_key[256]; // RSA-2048输出
rsa_encrypt(aes_key, 32, rsa_pubkey, encrypted_key);
// 7. 写入:加密数据 + 加密密钥 + IV到文件
write_file(filepath, encrypted_data, encrypted_key, iv);
// 8. 将文件重命名为带有勒索软件扩展名的名称
rename_file(filepath, strcat(filepath, ".locked"));
}Step 4: Check for Cryptographic Weaknesses
步骤4:检查加密弱点
Test the implementation for exploitable flaws:
python
from Crypto.Cipher import AES
import os
import struct测试实现中的可利用缺陷:
python
from Crypto.Cipher import AES
import os
import structTest 1: Check if same key is used for multiple files
测试1:检查多个文件是否使用相同密钥
Compare encrypted versions of known files
比较已知文件的加密版本
def check_key_reuse(file1_enc, file2_enc):
with open(file1_enc, "rb") as f:
data1 = f.read()
with open(file2_enc, "rb") as f:
data2 = f.read()
# Extract IVs (location depends on ransomware family)
# If IVs are same and files share encrypted blocks -> same key
iv1 = data1[-16:] # Example: IV at end
iv2 = data2[-16:]
if iv1 == iv2:
print("[!] Same IV detected - key reuse likely")def check_key_reuse(file1_enc, file2_enc):
with open(file1_enc, "rb") as f:
data1 = f.read()
with open(file2_enc, "rb") as f:
data2 = f.read()
# 提取IV(位置取决于勒索软件家族)
# 如果IV相同且文件共享加密块 -> 可能使用相同密钥
iv1 = data1[-16:] # 示例:IV在文件末尾
iv2 = data2[-16:]
if iv1 == iv2:
print("[!] 检测到相同IV - 可能存在密钥复用")Test 2: Check for predictable key derivation
测试2:检查可预测的密钥派生
If key is derived from timestamp, iterate possible values
如果密钥由时间戳派生,遍历可能的值
def brute_force_timestamp_key(encrypted_file, known_header, timestamp_range):
with open(encrypted_file, "rb") as f:
encrypted_data = f.read()
for ts in timestamp_range:
# Derive key the same way ransomware does
import hashlib
key = hashlib.sha256(str(ts).encode()).digest()
iv = encrypted_data[-16:]
cipher = AES.new(key, AES.MODE_CBC, iv)
decrypted = cipher.decrypt(encrypted_data[:16])
if decrypted[:len(known_header)] == known_header:
print(f"[!] Key found! Timestamp: {ts}")
return key
return Nonedef brute_force_timestamp_key(encrypted_file, known_header, timestamp_range):
with open(encrypted_file, "rb") as f:
encrypted_data = f.read()
for ts in timestamp_range:
# 按照勒索软件的方式派生密钥
import hashlib
key = hashlib.sha256(str(ts).encode()).digest()
iv = encrypted_data[-16:]
cipher = AES.new(key, AES.MODE_CBC, iv)
decrypted = cipher.decrypt(encrypted_data[:16])
if decrypted[:len(known_header)] == known_header:
print(f"[!] 找到密钥!时间戳: {ts}")
return key
return NoneTest 3: Check for ECB mode (pattern preservation)
测试3:检查ECB模式(模式保留)
def check_ecb_mode(encrypted_file):
with open(encrypted_file, "rb") as f:
data = f.read()
# ECB produces identical ciphertext for identical plaintext blocks
blocks = [data[i:i+16] for i in range(0, len(data), 16)]
unique = len(set(blocks))
total = len(blocks)
if unique < total * 0.95:
print(f"[!] ECB mode likely: {total-unique} duplicate blocks out of {total}")
undefineddef check_ecb_mode(encrypted_file):
with open(encrypted_file, "rb") as f:
data = f.read()
# ECB会为相同的明文块生成相同的密文
blocks = [data[i:i+16] for i in range(0, len(data), 16)]
unique = len(set(blocks))
total = len(blocks)
if unique < total * 0.95:
print(f"[!] 可能为ECB模式:{total-unique}个重复块,共{total}个块")
undefinedStep 5: Attempt Key Recovery
步骤5:尝试密钥恢复
Use identified weaknesses for key recovery:
python
undefined利用已识别的弱点进行密钥恢复:
python
undefinedRecovery Method 1: Extract key from memory dump
恢复方法1:从内存转储中提取密钥
Volatility plugin to scan for AES key schedules
Volatility插件扫描AES密钥调度
vol3 -f memory.dmp windows.yarascan --yara-rule "aes_key_schedule"
vol3 -f memory.dmp windows.yarascan --yara-rule "aes_key_schedule"
Recovery Method 2: Known-plaintext attack (weak algorithms)
恢复方法2:已知明文攻击(弱算法)
def xor_key_recovery(encrypted_file, known_plaintext):
"""Recover XOR key from known plaintext-ciphertext pair"""
with open(encrypted_file, "rb") as f:
ciphertext = f.read()
key = bytes(c ^ p for c, p in zip(ciphertext, known_plaintext))
# Find repeating key length
for key_len in range(1, 256):
candidate = key[:key_len]
if all(key[i] == candidate[i % key_len] for i in range(min(len(key), key_len * 4))):
print(f"XOR key (length {key_len}): {candidate.hex()}")
return candidate
return Nonedef xor_key_recovery(encrypted_file, known_plaintext):
"""从已知明文-密文对中恢复XOR密钥"""
with open(encrypted_file, "rb") as f:
ciphertext = f.read()
key = bytes(c ^ p for c, p in zip(ciphertext, known_plaintext))
# 查找重复密钥长度
for key_len in range(1, 256):
candidate = key[:key_len]
if all(key[i] == candidate[i % key_len] for i in range(min(len(key), key_len * 4))):
print(f"XOR密钥(长度{key_len}):{candidate.hex()}")
return candidate
return NoneRecovery Method 3: Check NoMoreRansom for existing decryptors
恢复方法3:在NoMoreRansom上查找现有解密工具
undefinedundefinedStep 6: Document Encryption Analysis
步骤6:记录加密分析结果
Compile findings into a structured report:
Analysis should document:
- Algorithm identified (AES, RSA, ChaCha20, custom)
- Key size and mode of operation (CBC, CTR, ECB, GCM)
- Key generation method (CSPRNG, predictable seed, static key)
- Key storage location (appended to file, registry, C2 transmission)
- File modification pattern (full encryption, partial, header-only)
- Targeted file extensions
- Ransom note format and payment infrastructure
- Decryption feasibility assessment (possible/impossible/partial)
- Recommended recovery approach将发现整理为结构化报告:
分析应记录:
- 识别出的算法(AES、RSA、ChaCha20、自定义)
- 密钥大小和操作模式(CBC、CTR、ECB、GCM)
- 密钥生成方法(CSPRNG、可预测种子、静态密钥)
- 密钥存储位置(附加到文件、注册表、C2传输)
- 文件修改模式(完全加密、部分加密、仅加密头部)
- 目标文件扩展名
- 勒索信格式和支付基础设施
- 解密可行性评估(可行/不可行/部分可行)
- 推荐的恢复方法Key Concepts
核心概念
| Term | Definition |
|---|---|
| Hybrid Encryption | Combining symmetric (AES) for fast file encryption with asymmetric (RSA) for secure key wrapping; the standard ransomware approach |
| Key Wrapping | Encrypting the per-file symmetric key with the attacker's RSA public key so only the attacker's private key can decrypt it |
| ECB Mode | Electronic Codebook mode encrypts each block independently; preserves patterns in plaintext, a critical weakness enabling partial recovery |
| Known-Plaintext Attack | Using a known original file and its encrypted version to derive the encryption key; effective against XOR and weak stream ciphers |
| Key Schedule | The expanded form of an AES key in memory; scannable in memory dumps to recover encryption keys before they are erased |
| CSPRNG | Cryptographically Secure Pseudo-Random Number Generator; ransomware using CryptGenRandom produces unpredictable keys |
| Partial Encryption | Some ransomware only encrypts the first N bytes or every Nth block for speed; unencrypted portions may aid recovery |
| 术语 | 定义 |
|---|---|
| Hybrid Encryption(混合加密) | 将对称加密(AES)用于快速文件加密与非对称加密(RSA)用于安全密钥封装相结合;勒索软件的标准方法 |
| Key Wrapping(密钥封装) | 使用攻击者的RSA公钥加密每个文件的对称密钥,因此只有攻击者的私钥才能解密它 |
| ECB Mode(ECB模式) | 电子密码本模式独立加密每个块;保留明文模式,是一个关键弱点,可实现部分恢复 |
| Known-Plaintext Attack(已知明文攻击) | 使用已知的原始文件及其加密版本派生加密密钥;对XOR和弱流密码有效 |
| Key Schedule(密钥调度) | AES密钥在内存中的扩展形式;可在内存转储中扫描以在密钥被擦除前恢复加密密钥 |
| CSPRNG | 加密安全伪随机数生成器;使用CryptGenRandom的勒索软件会生成不可预测的密钥 |
| Partial Encryption(部分加密) | 某些勒索软件仅加密前N字节或每隔N个块以提高速度;未加密部分可能有助于恢复 |
Tools & Systems
工具与系统
- Ghidra: Reverse engineering suite for analyzing ransomware encryption routines at the assembly level
- PyCryptodome: Python cryptographic library for implementing and testing decryption routines
- NoMoreRansom.org: Free decryption tool repository maintained by Europol and security vendors for known ransomware families
- Volatility: Memory forensics framework for extracting encryption keys from RAM dumps of infected systems
- CryptoTester: Tool for identifying cryptographic algorithms based on constants and code patterns
- Ghidra:用于在汇编级别分析勒索软件加密例程的逆向工程套件
- PyCryptodome:用于实现和测试解密例程的Python加密库
- NoMoreRansom.org:由欧洲刑警组织和安全厂商维护的免费解密工具库,针对已知勒索软件家族
- Volatility:内存取证框架,用于从受感染系统的RAM转储中提取加密密钥
- CryptoTester:基于常量和代码模式识别加密算法的工具
Common Scenarios
常见场景
Scenario: Assessing Decryption Feasibility for a Ransomware Incident
场景:评估勒索软件事件的解密可行性
Context: An organization is hit with ransomware encrypting file servers. Management needs to know if decryption is possible without paying the ransom before making a recovery decision.
Approach:
- Identify the ransomware family from ransom note, file extension, and sample hash (check ID Ransomware)
- Check NoMoreRansom.org for existing free decryptors for this family
- Reverse engineer the encryption routine in Ghidra to identify the algorithm and key management
- Test for implementation weaknesses (key reuse, predictable seeds, ECB mode)
- Check if PCAP from the incident captured the key transmission to C2 (if key was sent before encryption)
- Scan memory dumps from affected machines for AES key schedules in RAM
- Report findings: decryption possible/impossible with specific technical justification
Pitfalls:
- Testing decryption methods on the only copy of encrypted files (always work on copies)
- Assuming all files use the same key without verifying (some ransomware uses per-file keys)
- Not checking for volume shadow copies (vssadmin) which ransomware may have failed to delete
- Confusing the file encryption algorithm with the key wrapping algorithm in reports
背景:某组织遭遇勒索软件攻击,文件服务器被加密。管理层需要在做出恢复决策前了解无需支付赎金即可解密的可能性。
方法:
- 根据勒索信、文件扩展名和样本哈希识别勒索软件家族(查询ID Ransomware)
- 在NoMoreRansom.org上查询该家族是否有现有免费解密工具
- 使用Ghidra逆向工程加密例程,识别算法和密钥管理方式
- 测试实现弱点(密钥复用、可预测种子、ECB模式)
- 检查事件的PCAP是否捕获了密钥传输到C2的过程(如果密钥在加密前发送)
- 扫描受感染机器的内存转储,查找RAM中的AES密钥调度
- 报告结果:解密可行/不可行,并提供具体技术依据
注意事项:
- 在加密文件的唯一副本上测试解密方法(始终使用副本进行操作)
- 在未验证的情况下假设所有文件使用相同密钥(某些勒索软件使用每个文件唯一密钥)
- 未检查卷影副本(vssadmin),勒索软件可能未删除这些副本
- 在报告中混淆文件加密算法与密钥封装算法
Output Format
输出格式
RANSOMWARE ENCRYPTION ANALYSIS
================================
Sample: lockbit3.exe
Family: LockBit 3.0 / LockBit Black
SHA-256: abc123def456...
ENCRYPTION SCHEME
File Cipher: AES-256-CTR (per-file unique key)
Key Wrapping: RSA-2048 (public key embedded in binary)
Key Generation: CryptGenRandom (CSPRNG - unpredictable)
IV Generation: Random 16 bytes per file
File Structure: [encrypted_data][rsa_encrypted_key(256B)][iv(16B)][magic(8B)]
TARGETED EXTENSIONS
Total: 412 extensions targeted
Categories: Documents (.doc, .xls, .pdf), Databases (.sql, .mdb),
Archives (.zip, .7z), Source code (.py, .java, .cs)
Excluded: .exe, .dll, .sys, .lnk (system files preserved)
IMPLEMENTATION ANALYSIS
Key Strength: STRONG - per-file random keys, no reuse
Mode Security: STRONG - CTR mode with unique nonces
Key Storage: RSA-encrypted key appended to each file
Shadow Copies: Deleted via vssadmin and WMI
DECRYPTION FEASIBILITY
Without Key: NOT POSSIBLE
- No implementation flaws identified
- RSA-2048 key wrapping prevents brute force
- CSPRNG prevents key prediction
- No existing free decryptor available
RECOVERY OPTIONS
1. Restore from offline backups (recommended)
2. Check for volume shadow copies (low probability - ransomware deletes them)
3. Memory forensics if machine was not rebooted (key may persist in RAM)
4. Negotiate with attacker (last resort - no guarantee of decryption)勒索软件加密分析报告
================================
样本: lockbit3.exe
家族: LockBit 3.0 / LockBit Black
SHA-256: abc123def456...
加密方案
文件密码: AES-256-CTR(每个文件唯一密钥)
密钥封装: RSA-2048(公钥嵌入二进制文件)
密钥生成: CryptGenRandom(CSPRNG - 不可预测)
IV生成: 每个文件随机生成16字节
文件结构: [加密数据][RSA加密密钥(256B)][IV(16B)][魔术字节(8B)]
目标扩展名
总数: 412个目标扩展名
类别: 文档(.doc、.xls、.pdf)、数据库(.sql、.mdb)、
归档文件(.zip、.7z)、源代码(.py、.java、.cs)
排除: .exe、.dll、.sys、.lnk(保留系统文件)
实现分析
密钥强度: 强 - 每个文件随机密钥,无复用
模式安全性: 强 - 使用唯一随机数的CTR模式
密钥存储: RSA加密密钥附加到每个文件
卷影副本: 通过vssadmin和WMI删除
解密可行性
无密钥: 不可行
- 未识别到实现缺陷
- RSA-2048密钥封装阻止暴力破解
- CSPRNG阻止密钥预测
- 无现有免费解密工具可用
恢复选项
1. 从离线备份恢复(推荐)
2. 检查卷影副本(概率低 - 勒索软件已删除)
3. 若机器未重启则进行内存取证(密钥可能仍在RAM中)
4. 与攻击者协商(最后手段 - 无法保证解密)