Math for Security

Book description

Explore the intersection of mathematics and computer security with this engaging and accessible guide.

Math for Security will equip you with essential tools to tackle complex security problems head on. All you need are some basic programming skills. Once youâ??ve set up your development environment and reviewed the necessary Python syntax and math notation in the early chapters, youâ??ll dive deep into practical applications, leveraging the power of math to analyze networks, optimize resource distribution, and much more. In the bookâ??s final chapters, youâ??ll take your projects from proof of concepts to viable applications and explore options for delivering them to end users.

As you work through various security scenarios, youâ??ll:

â?¢Employ packet analysis and graph theory to detect data exfiltration attempts in a network

â?¢Predict potential targets and find weaknesses in social networks with Monte Carlo simulations

â?¢Use basic geometry and OpenCell data to triangulate a phoneâ??s location without GPS

â?¢Apply computational geometry to Voronoi diagrams for use in emergency service planning

â?¢Train a facial recognition system with machine learning for real-time identity verification

â?¢Use spatial analysis to distribute physical security features effectively in an art gallery

Whether youâ??re an aspiring security professional, a social network analyst, or an innovator seeking to create cutting-edge security solutions, this book will empower you to solve complex problems with precision and confidence. Embrace the intricate world of math as your secret weapon in computer security!

Table of contents

  1. Title Page
  2. Copyright
  3. Dedication
  4. About the Author
  5. Acknowledgments
  6. Introduction
    1. Who Should Read This Book?
    2. What’s in This Book?
    3. Why Python?
    4. Information Accessibility
    5. Online Resources
  7. Part I: Environment and Conventions
    1. Chapter 1: Setting Up the Environment
      1. Simple Environment Configuration with Anaconda
        1. Linux
        2. Windows
        3. macOS
      2. Setting Up a Virtual Environment
      3. Installing the IDE with Anaconda
      4. Advanced Setup
        1. Setting Up virtualenv
        2. Installing the IDE without Anaconda
      5. Jupyter Notebooks
      6. Summary
    2. Chapter 2: Programming and Math Conventions
      1. Syntactical Constructs
        1. List Comprehensions
        2. Dictionary Comprehensions
        3. Zipping and Unpacking
      2. Mathematical Notation
        1. Boolean Notation
        2. Set Notation
        3. Attribute Characters
        4. Greek Letters and Functions
      3. Summary
  8. Part II: Graph Theory and Computational Geometry
    1. Chapter 3: Securing Networks with Graph Theory
      1. Graph Theory for Security Applications
      2. Creating Graphs in NetworkX
      3. Discovering Relationships in Data
        1. Measuring Node Importance
        2. Analyzing Cliques to Track Associations
        3. Determining the Connectedness of the Network
        4. Using Graph Edges to Capture Important Details
      4. Summary
    2. Chapter 4: Building a Network Traffic Analysis Tool
      1. Network Topology Visualization
      2. Converting Network Information into a Graph
        1. Building a Communication Map
        2. Building the Graph
      3. Identifying Suspicious Machine Behavior
        1. Subgraph of Port Data Volume
        2. Identifying Unusual Levels of Traffic
        3. Examining How Machines Interact on the Network
      4. The Proof of Concept: Network Traffic Analysis
      5. Summary
    3. Chapter 5: Identifying Threats with Social Network Analysis
      1. The Small-World Phenomenon
      2. Graphing Social Network Data
        1. Structuring the Data
        2. Visualizing the Social Network
      3. Network Analysis Insights
        1. Calculating Information Propagation
        2. Identifying Cliques and Most Influential Users
        3. Finding the Most Influenced Users
        4. Using Topic-Based Information Exchange
        5. Analyzing Network Organization
      4. The Proof of Concept: Social Network Analysis
      5. The Darker Side of Social Network Analysis
      6. Summary
    4. Chapter 6: Analyzing Social Networks to Prevent Security Incidents
      1. Using Monte Carlo Simulations to Predict Attacks
        1. Finite State Machines
        2. Network Modeling with Random Walks
        3. Monte Carlo Simulation
      2. Simulating Social Networks
        1. Modeling User Interaction
        2. Modeling Topic-Based Influence
        3. Modeling Information Flow
      3. The Proof of Concept: Disrupting the Flow of Information
        1. Modeling an Evolving Network
        2. Moving the Message Through the Network
        3. Measuring the Amount of Information Flow
        4. How the Game Works
        5. The Game Objective
        6. The Game Simulation
        7. Improvements to Player 2
      4. Summary
    5. Chapter 7: Using Geometry to Improve Security Practices
      1. Describing Shapes
        1. Points and Lines
        2. Polygons
        3. Vertex Order
      2. Scenario: Planning Security for a Concert
        1. Calculating Safe Occupancy Limits
        2. Determining Placement of Security Personnel
        3. Estimating Guard Patrol Timing
        4. Improving Guard Placement
      3. Summary
    6. Chapter 8: Tracking People in Physical Space with Digital Information
      1. Gathering Cellular Network Data
      2. Ethics of Tracking Devices and People
      3. The OpenCellID API Structure
      4. The Proof of Concept: Locating a Device from Nearby Cell Towers
        1. Gathering Tower Locations
        2. Translating a Geographic Point to a Polygon
        3. Calculating the Search Area
        4. Mapping the Search Area for Investigators
        5. Reducing the Search Area
      5. Summary
    7. Chapter 9: Computational Geometry for Safety Resource Distribution
      1. Using Voronoi Tessellation for Resource Distribution
      2. The Proof of Concept: Analyzing Fire Station Coverage
        1. Defining the Distance Function
        2. Determining the City Shape
        3. Gathering the Locations of Existing Fire Stations
        4. Performing the Voronoi Analysis
      3. Limitations of the Algorithm
      4. Summary
    8. Chapter 10: Computational Geometry for Facial Recognition
      1. Uses of Facial Recognition in Security
      2. Ethics of Facial Recognition Research
      3. The Facial Recognition Algorithm
        1. Using Decision Tree Classifiers
        2. Representing Facial Geometry
        3. Processing Image Data
        4. Locating Facial Landmarks
      4. The Proof of Concept: Developing a Facial Recognition System
        1. Facial Statistics
        2. Memory Management
        3. Data Loading
        4. Feature Engineering
        5. Model Training
        6. Model Persistence
      5. Summary
  9. Part III: The Art Gallery Problem
    1. Chapter 11: Distributing Security Resources to Guard a Space
      1. Determining the Minimum Number of Guards
      2. Art Gallery Problem Theory
      3. Geometric and Graph Representations of the Gallery
      4. Securing the Gallery
        1. Mapping Guard Coverage
        2. Defining Obstructed Areas
        3. Prioritizing Guard Coverage Areas
        4. Mapping Security Camera Field of View
      5. Summary
    2. Chapter 12: The Minimum Viable Product Approach to Security Software Development
      1. Mapping the User’s Interactions
        1. Planning Application States
        2. Documenting the Application
      2. Developing the State Manager
      3. Accelerating Security with Parallel Processing
        1. Threading Parallelism
        2. Processor Parallelism
      4. Adding a Graphical User Interface
        1. Displaying and Managing Images in PyGame
        2. Organizing Graphics with Sprites and Layers
      5. Saving and Reloading Project Data
        1. Saving to a Dictionary
        2. Loading from JSON Files
      6. Running the Example Application
      7. Summary
    3. Chapter 13: Delivering Python Applications
      1. Using Setup Scripts
      2. Packaging with Python Interpreters
      3. Distributing with Cloud Microservices
      4. Licensing with PyArmor
      5. Open Source Delivery
      6. Summary
  10. Notes
  11. Index

Product information

  • Title: Math for Security
  • Author(s): Daniel Reilly
  • Release date: October 2023
  • Publisher(s): No Starch Press
  • ISBN: 9781718502567