Educational Ransomware-Style Encryption Tool (Rust)
Strictly educational and defensive scope: these two projects aim to understand, hands-on, how a ransomware works internally (mass encryption, signature evasion techniques) in order to detect and counter it more effectively. The code was never deployed outside a controlled test environment and includes no propagation, persistence, or command-and-control networking functionality.
Context
Two distinct deliverables around the same theme, produced at different points in the
Bachelor 3 curriculum. The first is the group annual project: a Rust CLI for encrypting and
decrypting files, built through successive iterations (pre_prod/encrypt_file,
devil_encryption_folder, final_enc_dec_cli, up to
rendu_final). The second, done solo as part of a dedicated Rust course, extends
the same theme with HKDF/HMAC/SHA2 key derivation and, most notably, a metamorphic source
rewriting module that the group project does not have.
What was built
- Command-line interface built with
clap, encrypting/decrypting individual files or entire directories walked recursively viawalkdir. - Three supported AES key sizes (128/192/256 bits), random key and IV generation.
- In the solo version: sound key derivation (HKDF/HMAC/SHA2 rather than a raw key) and timestamping of operations.
- The
metamorphic.rsmodule: automatic rewriting of the source code (variable renaming, random NOP insertion) followed by recompilation, producing a functionally identical binary whose static signature (hash, byte patterns) changes on every build - the same logic real malware uses to evade signature-based detection.
Stack
Status
Both parts are complete and were submitted as part of their respective courses.