
First-ever decryptor for The Gentlemen ransomware — recovers encryption keys from process memory dumps using X25519 ephemeral key extraction. 35/35 files decrypted. Research by Bedrock Safeguard Inc.
The first publicly available decryption method for The Gentlemen ransomware.
The Gentlemen (also known as hastalamuerte) is currently the most active ransomware-as-a-service (RaaS) operation globally, with 320+ confirmed victims as of Q1 2026. Until now, every major security vendor — Cybereason, Group-IB, Check Point, ASEC, Trend Micro — assessed the encryption as cryptographically unbreakable. No public decryptor existed.
We broke it.
The Gentlemen uses XChaCha20 stream encryption with X25519 ECDH key exchange. Each file is encrypted with a unique key derived from a fresh ephemeral key pair. The encryption is mathematically sound — we didn't break the math.
We broke the implementation.
Go does not zero cryptographic key material on the heap after use (CWE-244). Once an ephemeral X25519 private key is generated for a file, it lingers in process memory rather than being wiped — so a dump of the live process recovers the keys for files already encrypted, often in multiple GC-left copies. The OS reclaims this memory once the process exits.
A memory dump of the live process, taken during or near the end of encryption, typically contains the ephemeral keys for every file processed up to that point — in our 35-file analysis, all of them.
Results: 35/35 files decrypted with 100% accuracy. All 35 keys recovered in 0.6 seconds from a single memory dump.
If you've been hit by The Gentlemen ransomware, you may be able to recover files if a memory image of the ransomware process was captured while it was running. Recovery works by extracting the per-file ephemeral private keys from that image, so it is best-effort and may be partial — only files whose key had already been generated and was still resident at the moment of capture can be recovered.
What that means in practice:
Where a usable memory image may exist — each only helps if it captured the process while it was running:
procdump, Task Manager → "Create dump file", or another forensic tool to capture the ransomware process before terminating it.C:\ProgramData\Microsoft\Windows\WER\.C:\Windows\Minidump\ and C:\Windows\MEMORY.DMP, if a bugcheck occurred while the process was running (only complete memory dumps include process memory; minidumps usually do not).C:\hiberfil.sys, if the system hibernated while the ransomware process was active (it freezes a RAM snapshot at that moment).Not sure whether any of these exist for your incident? Contact us at [email protected] and we can help you check.
# 1. Install dependencies
pip install cryptography
# 2. Extract ephemeral public keys from your encrypted files
python extract_keys_from_files.py --input-dir /path/to/encrypted/files --output keys.json
# 3. Search the memory dump for matching private keys
python recover_keys.py --dump process_memory.dmp --pubkeys keys.json --output recovered_keys.json
# 4. Decrypt your files
python decrypt.py --keys recovered_keys.json --input-dir /path/to/encrypted/files --output-dir /path/to/recovered
--fast / --superfast / --ultrafast)The Gentlemen locker supports speed flags that perform partial encryption on
files larger than 1 MB. Under --superfast, only ~3% of bytes in a large file
are encrypted; the remaining ~97% is left as plaintext at the original disk
position. This is verified across published RE (ASEC, Trend Micro, Cybereason).
Whole-body XChaCha20 decryption on a partial-encryption file would DOUBLE-CORRUPT the unencrypted regions — XOR'ing keystream over the plaintext segments turns them to garbage and destroys recoverable data.
For this reason, decrypt.py refuses to process files larger than 1 MB by
default. If you have verified the locker ran in full-encryption mode (small
files only, or a build without the speed flags), pass --force-large to
override.
For partial-encryption victims, use format-aware recovery tools on the unencrypted regions instead:
Bedrock Safeguard is actively reverse-engineering the chunk-offset geometry of partial-encryption mode. When that work completes, this decryptor will be updated to safely handle the partially-encrypted segments.
Per-file encryption:
1. Generate 32 random bytes -> ephemeral private key (crypto/rand.Read)
2. X25519(ephemeral_priv, operator_pub) -> shared_secret (32 bytes)
3. XChaCha20(plaintext, shared_secret) -> ciphertext
4. Append to file: --eph--<base64(ephemeral_PUBLIC_key)>--marker--GENTLEMEN
The ephemeral private key is the critical secret. It exists only in process memory and is never written to disk. But Go's goroutine stack allocator does not zero memory when variables go out of scope (CWE-244), leaving the key material accessible via memory forensics.
| ID | Description |
|---|---|
| CWE-244 | Improper Clearing of Heap Memory Before Release |
| CWE-316 | Cleartext Storage of Sensitive Information in Memory |
public = X25519(candidate, basepoint)shared_secret = X25519(ephemeral_private, operator_public)| IOC | Value |
|---|---|
| Operator X25519 Public Key | fcb11717cab989424755a957c1d55361b119de4fdcfecdb2f2e56b15ad801922 |
| Field | Value |
|---|---|
| SHA256 | 3ab9575225e00a83a4ac2b534da5a710bdcf6eb72884944c437b5fbe5c5c9235 |
| Type | PE32+ x64, Go binary, Garble-obfuscated |
| Size | 2,962,944 bytes |
| First Seen | 2026-04-03 |
| Indicator | Value |
|---|---|
| Ransom Note | README-GENTLEMEN.txt |
| Encrypted Extension | Randomized per build (e.g., .axfsmg) |
| File Footer | --eph--<base64>--marker--GENTLEMEN |
vssadmin and wmicAdd-MpPreferencegentlemen.bmpLOCKER_BACKGROUND=1 environment variable--path, --fast, --full, --shares, --silent, --system, -T (delay)This research led to the development of Bedrock RansomGuard — an open-source Windows service that automatically detects ransomware encryption and captures process memory before keys are destroyed. RansomGuard works against any ransomware family, not just The Gentlemen.
This work extends Adrien Guinet's WannaCry key recovery (2017) to modern Go-based ransomware using elliptic curve cryptography. To our knowledge, this is the first published application of X25519 ephemeral key recovery from memory forensics against any ransomware family.
This project is licensed under the Business Source License 1.1 — free for all non-commercial use, internal business use, incident response, and academic research.
Bedrock Safeguard Inc. is a Canadian cybersecurity intelligence firm specializing in threat actor infrastructure analysis, malware reverse engineering, and digital forensics. This research was conducted as part of our mission to protect Canadian organizations and individuals from ransomware threats.
If you are a victim of The Gentlemen ransomware and need assistance with key recovery, contact us at [email protected].
| TOX ID | 88984846080D639C9A4EC394E53BA616D550B2B3AD691942EA2CCD33AA5B9340FD1A8FF40E9A |
| Negotiation Email | [email protected] |
| Leak Site (.onion) | tezwsse5czllksjb7cwp65rvnk4oobmzti2znn42i43bjdfd2prqqkad.onion |