Go to file
2025-07-08 14:24:10 +02:00
id_rsa initial commit 2025-07-08 14:24:10 +02:00
id_rsa.pub initial commit 2025-07-08 14:24:10 +02:00
README.md initial commit 2025-07-08 14:24:10 +02:00
requirements.txt initial commit 2025-07-08 14:24:10 +02:00
setup.sh initial commit 2025-07-08 14:24:10 +02:00
stockholm.py initial commit 2025-07-08 14:24:10 +02:00
swat.py initial commit 2025-07-08 14:24:10 +02:00

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

  1. Generates master symmetric key (Fernet)
  2. Creates unique key for each file
  3. Encrypts files in 64KB chunks
  4. Master key encrypted with RSA public key
  5. 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