How oakkaya/prince-ransomware works
Project type and purpose
• This is a Go-based monorepo containing three related CLI tools:
a. Builder – generates or prepares configuration/keys
b. Encryptor – walks a directory tree and encrypts files
c. Decryptor – walks a directory tree and decrypts files
• There is no web/UI layer; it’s a file-system-oriented, pipeline-style encryption suite.
File structure
• Top-level: Build.bat, LICENSE, README.md
• Three submodules (each its own go.mod):
• Builder/…
• Encryptor/…
• Decryptor/…
• Encryptor has packages: configuration, filewalker, encryption
• Decryptor has packages: configuration, iterator, decryption
• Builder likely has a configuration/templating or key-gen logic in main.go
No README details → infer from filenames
• “configuration” packages parse config files or flags
• “filewalker”/“iterator” traverse directories and enumerate files
• “encryption”/“decryption” implement the cryptographic operations
Main components
a. CLI User (entry point)
b. Builder Service
• Config Generator
• (Optional) Key Management
→ Outputs: configuration file(s) and key artifacts
c. Encryptor Service
• Config Loader
• FileWalker
• Encryption Engine
→ Inputs: plaintext directory + config/keys
→ Outputs: encrypted files to target directory
d. Decryptor Service
• Config Loader
• Iterator
• Decryption Engine
→ Inputs: encrypted files + config/keys
→ Outputs: decrypted files
e. File System (source and target directories)
Relationships and dataflow
• User invokes Builder → produces config.json / key files
• User invokes Encryptor with config → FileWalker reads plaintext files → Encryption Engine uses keys → writes encrypted output
• User invokes Decryptor with config → Iterator reads encrypted files → Decryption Engine restores original → writes decrypted output
Architectural patterns and design principles
• Modular CLI tools (separation of concerns by function)
• Layered structure within each module:
• Configuration layer (parsing)
• Traversal layer (filewalker/iterator)
• Core crypto engine (encrypt/decrypt)
• Monorepo approach for shared conventions but isolated go.mod per tool
Technologies, frameworks, libraries
• Go (Go modules)
• Standard library for file I/O and crypto, or third-party crypto libs if imported
• Build.bat for Windows convenience