/
Tech-study-notes

02_technical_foundations

The Tor Network Architecture

What is Tor?

Tor (The Onion Router) is a free, open-source software that enables anonymous communication by directing internet traffic through a worldwide volunteer overlay network consisting of more than 7,000 relays.

How Tor Works

The Three-Node Circuit

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   User   β”‚ ───→ β”‚ Entry Guard β”‚ ───→ β”‚ Middle Relay β”‚ ───→ β”‚ Exit Relay  β”‚ ───→ β”‚ Destination  β”‚
β”‚(You)     β”‚      β”‚  (Node 1)   β”‚      β”‚   (Node 2)   β”‚      β”‚  (Node 3)   β”‚      β”‚  (Website)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
      β”‚                 β”‚                      β”‚                    β”‚                   β”‚
      β”‚                 β”‚                      β”‚                    β”‚                   β”‚
   Your IP           First Node              Second Node          Third Node        Website sees
  (Hidden)            IP                    IP                   IP              Exit Node IP

Node Functions:

  1. Entry Guard (First Node)

    • Only node that knows your real IP address
    • Remains consistent throughout your session
    • Encrypts traffic and passes to middle relay
  2. Middle Relay (Second Node)

    • Randomly selected from pool of thousands
    • Receives encrypted traffic from entry guard
    • Passes to exit relay
    • Neither knows origin nor destination
  3. Exit Relay (Third Node)

    • Final node in the circuit
    • Decrypts last layer of encryption
    • Sends unencrypted traffic to destination
    • Destination sees exit node’s IP, not yours

Encryption Layers

Tor uses onion routing - multiple layers of encryption like an onion:

Original Data
    ↓
[Encrypted for Exit Node]
    ↓
[Encrypted for Middle Relay]
    ↓
[Encrypted for Entry Guard]
    ↓
Transmitted through Tor network

Each node can only decrypt its own layer, revealing only the next hop.

Security Considerations

Vulnerabilities:

  1. Exit Node Monitoring

    • Traffic between exit node and destination is unencrypted (unless using HTTPS)
    • Malicious exit nodes can capture unencrypted data
    • Mitigation: Always use HTTPS websites when possible
  2. Traffic Correlation

    • Sophisticated adversaries can correlate entry/exit timing
    • Requires significant resources (nation-state level)
    • Mitigation: Use additional VPN or bridges
  3. Browser Fingerprinting

    • Screen resolution, fonts, plugins can identify users
    • Mitigation: Use Tor Browser’s default window size

PGP (Pretty Good Privacy)

Overview

PGP provides cryptographic privacy and authentication for data communication. It uses a combination of:

How PGP Works

Key Exchange Process

Alice wants to send secure message to Bob

Step 1: Key Generation
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Alice  β”‚                    β”‚   Bob   β”‚
β”‚ Generateβ”‚                    β”‚ Generateβ”‚
β”‚Key Pair β”‚                    β”‚Key Pair β”‚
β”‚         β”‚                    β”‚         β”‚
β”‚ Public  β”‚                    β”‚ Public  β”‚
β”‚ Private β”‚                    β”‚ Private β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Step 2: Public Key Exchange
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”   Public Key    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Alice  β”‚ ──────────────→ β”‚   Bob   β”‚
β”‚         β”‚                 β”‚         β”‚
β”‚  Bob's  β”‚ ←────────────── β”‚ Alice's β”‚
β”‚  Public β”‚    Public Key   β”‚  Public β”‚
β”‚   Key   β”‚                 β”‚   Key   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Step 3: Encryption & Transmission
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Alice  β”‚                   β”‚   Bob   β”‚
β”‚ Message β”‚                   β”‚         β”‚
β”‚    ↓    β”‚                   β”‚    ↓    β”‚
β”‚ Encrypt β”‚ ──Encrypted Msg──→β”‚ Decrypt β”‚
β”‚w/ Bob's β”‚                   β”‚w/ Bob's β”‚
β”‚  Public β”‚                   β”‚ Private β”‚
β”‚   Key   β”‚                   β”‚   Key   β”‚
β”‚    ↓    β”‚                   β”‚    ↓    β”‚
β”‚ Ciphertextβ”‚                 β”‚ Originalβ”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Components

Public Key:

Private Key:

Real-World Example

Scenario: Journalist wants to receive anonymous tips

1. Journalist publishes their PUBLIC KEY on website
2. Source encrypts message using journalist's PUBLIC KEY
3. Source sends encrypted message over any channel (email, Tor, etc.)
4. Even if intercepted, message cannot be read without PRIVATE KEY
5. Journalist decrypts with their PRIVATE KEY
6. Only journalist can read the original message

Using PGP on the Deep Web

Common Applications:

  1. Email Encryption

    • ProtonMail has built-in PGP
    • Most secure email providers support PGP
  2. Market Communications

    • Encrypt shipping addresses
    • Verify vendor authenticity
  3. File Encryption

    • Protect sensitive documents
    • Create encrypted archives

Security Level Configuration

Tor Browser Security Settings

Level 1: Standard

Features:
- All website features enabled
- JavaScript allowed everywhere
- Media auto-plays
- Performance optimizations enabled

Best for: General browsing when convenience is priority

Level 2: Safer

Features:
- JavaScript disabled on non-HTTPS sites
- HTML5 media click-to-play
- Some font rendering disabled
- Performance optimizations reduced

Best for: Balanced security and usability

Level 3: Safest

Features:
- JavaScript disabled everywhere
- All media click-to-play
- Maximum security settings
- May break some sites

Best for: Maximum anonymity and security

MAC Address Spoofing

Purpose: Hide hardware identifier of network card

How to Enable (Tails OS):

  1. Boot Tails
  2. In startup options, check “MAC Address Spoofing”
  3. System will use random MAC address

Benefits:

Network Architecture Diagram

                    INTERNET
                       β”‚
         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
         β”‚             β”‚            β”‚
    β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”   β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”
    β”‚ Google  β”‚   β”‚ Regular β”‚   β”‚  Deep  β”‚
    β”‚ Search  β”‚   β”‚  Sites  β”‚   β”‚  Sites β”‚
    β”‚ (Clear) β”‚   β”‚ (Clear) β”‚   β”‚  (Tor) β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
                                    β”‚
                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚                     β”‚
                   β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”           β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”
                   β”‚  Hidden   β”‚           β”‚ Public β”‚
                   β”‚  Services β”‚           β”‚ Forums β”‚
                   β”‚  ("onion") β”‚           β”‚("onion")β”‚
                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Access Path:
Clear Web: User → ISP → Website
Deep Web:  User → Tor → Website
Dark Web:  User → Tor → "onion" Site

Common Technical Terms

TermDefinition
NodeServer in Tor network that relays traffic
RelayAnother term for Tor node
CircuitComplete path through Tor network (3 nodes)
Onion SiteWebsite with “onion” domain, only accessible via Tor
Exit NodeFinal node that connects to destination
Entry GuardFirst Tor node you connect to
BridgeHidden Tor entry point (censorship circumvention)
PGP KeyCryptographic key pair for encryption
FingerprintUnique identifier for a PGP key
MAC AddressHardware identifier for network interface

Technical Specifications

Tor Network Stats

PGP Specifications

Best Practices for Technical Security

  1. Keep Tor Browser Updated

    • Check for updates regularly
    • Use official Tor Project downloads
  2. Verify PGP Keys

    • Confirm key fingerprints
    • Use multiple trust sources
  3. Disable Unnecessary Features

    • No browser extensions
    • No JavaScript when not needed
    • No auto-play media
  4. Use Bridges in Restrictive Countries

    • Obfuscated bridges prevent detection
    • Built-in bridge configuration in Tor Browser
  5. Separate Identities

    • Never reuse usernames
    • Different passwords for each service
    • Separate email addresses