1.2 KiB
1.2 KiB
Stockholm - File Encryption Tool
A Python-based file encryption tool that simulates ransomware behavior for educational and security testing purposes.
Installation
source setup.sh
ssh-keygen -t rsa -b 2048 -f id_rsa -N ""
Usage
Encrypt files in ~/Infection directory:
python stockholm.py
Decrypt files:
# Get symmetric key
python swat.py "$(cat ~/Infection/encrypted_symmetric_key.bin)" --private_key id_rsa
# Decrypt files
python stockholm.py -r <symmetric_key>
Options
-r, --reverse <key>: Decrypt files using symmetric key-s, --silent: Run without output messages-v, --version: Show version information
How It Works
- Generates master symmetric key (Fernet)
- Creates unique key for each file
- Encrypts files in 64KB chunks
- Master key encrypted with RSA public key
- Original files are deleted after encryption
Security Features
- Hybrid encryption (RSA + Fernet)
- Unique file keys
- Memory efficient chunked processing
- Supports 100+ file extensions
Example Test Setup
mkdir -p ~/Infection/test
echo "test content" > ~/Infection/test/sample.txt
python stockholm.py