Front cover of Computer Security: The Foundations

Textbook — Computer Engineering · Chulalongkorn University

Computer Security
The Foundations

Krerk Piromsopa, Ph.D.

Department of Computer Engineering · Chulalongkorn University · Bangkok, Thailand

With a foreword by Richard J. Enbody

The complete book is available here as a free PDF, free for personal study and classroom use.

About This Book

For decades, computer security has played a critical role in the connected world. The widespread adoption of the internet, smartphones, and cloud services has raised the stakes dramatically: today the average person carries two or three networked computers at all times, and the consequences of a compromise—financial loss, identity theft, disruption of critical infrastructure—affect everyone, not just specialists.

Written for computer science and computer engineering students, this textbook is also readable by anyone who wishes to understand why security matters and how it works. It grew from two decades of teaching computer security at Chulalongkorn University.

The book is divided into three parts. Part I lays the conceptual groundwork: the CIA triad, the AAA framework, privacy, risk management, and social engineering. Part II equips the reader with the principal technical disciplines used to build and analyse secure systems: Cryptography, Software Security, Network Security, Digital Forensics, and AI & Machine Learning Security. Part III examines recurring vulnerability classes: Buffer Overflow, Input Validation and Injection Attacks, Physical Security, Malware, and Cloud Security.

Every chapter includes Learning Objectives, worked examples, exercises, and an annotated Further Reading list. A Glossary of key terms and an Index appear at the end of the book.

Recommended course focus

IT & Systems Administration Authentication, Authorization, Auditing, Physical Security, Malware, Cloud Security
Computer Science Cryptography, Buffer Overflow, Input Validation, Software Security, AI/ML Security
Computer Engineering Network Security, Buffer Overflow, Cryptography (emphasis)
Security Management Introduction (risk & privacy law), Auditing (incident response) as primary texts

Table of Contents

Part I — Fundamentals
  • Ch 1 Introduction to Computer Security
  • Ch 2 Authentication
  • Ch 3 Authorization
  • Ch 4 Auditing
  • Ch 5 Integrity
Part II — Security Tools
  • Ch 6 Cryptography
  • Ch 7 Software Security
  • Ch 8 Network Security
  • Ch 9 Digital Forensics
  • Ch 10 AI and Machine Learning Security
Part III — Common Security Issues
  • Ch 11 Buffer Overflow
  • Ch 12 Input Validation and Injection Attacks
  • Ch 13 Physical Security
  • Ch 14 Malware
  • Ch 15 Cloud Security
Appendix — Class Activities
  • A 2 Hacking Password
  • A 6 Fundamental of Cryptography
  • A 6b Public Key Infrastructure
  • A 7 Secure Software / Simple Web Server
  • A 8 Network Scanner with NMAP
  • A 9 Digital Forensics
  • A 11 Buffer Overflow
  • A 13 Physical Security

Activity numbers correspond to their chapter (e.g., Activity 9 supplements Chapter 9).

Class Activities

Hands-on activities accompany several chapters. The exercises below require downloadable files; all other activities use tools installed via the system package manager or freely available online.

Activity 2 — Chapter 2: Authentication

Hacking Password

Brute-force and rainbow-table attacks on SHA-1 hashed passwords using a common-credential dictionary.

Activity 6 — Chapter 6: Cryptography

Fundamental of Cryptography

Statistical analysis of Caesar cipher, Vigenère encryption, ECB/CBC block cipher modes, and digital signatures with OpenSSL.

Activity 6b — Chapter 6: Cryptography

Public Key Infrastructure

Inspect TLS certificate chains with OpenSSL, explore root and intermediate CAs, and implement certificate validation in Python.

Activity 7 — Chapter 7: Software Security

Secure Software / Simple Web Server

Progressively harden a minimalist Python HTTP server against DoS, information disclosure, and tampering attacks.

Activity 8 — Chapter 8: Network Security

Network Scanner with NMAP

Host discovery, port scanning (SYN/TCP/UDP), service & version detection, OS fingerprinting, NSE scripts, and output formats.

Activity 9 — Chapter 9: Digital Forensics

Digital Forensics

Extract GPS location from EXIF metadata; recover a deleted file from a disk image using TestDisk.

Activity 11 — Chapter 11: Buffer Overflow

Buffer Overflow

Stack layout analysis, stack smashing to redirect execution, and exploiting a buffer-overflow challenge binary with a Python script.

Activity 13 — Chapter 13: Physical Security

Physical Security

JavaScript injection via an unattended browser session; reverse-shell trapdoor using Netcat.

Downloads

The complete book, as a PDF Free download

The full text of Computer Security: The Foundations is published here as a free PDF, ISBN 978-616-637-558-9. This page is the official distribution point named on the book’s copyright page. A paperback edition, ISBN 978-616-637-567-1, is in preparation; ordering details will appear here when it is published.

The author grants permission for that PDF to be downloaded, stored, and printed for personal study, and to be reproduced without charge for non-commercial classroom instruction — provided the work is reproduced in full, that the copyright page is included, and that no fee is charged beyond the direct cost of reproduction. All other rights, including commercial reproduction, translation, and derivative works, remain reserved.

Download the book (PDF, 22 MB)

If the button does not work, use the direct link.

Activity files

All activity files are hosted here. Download them with your browser or with curl:

File Used in Description
simple_web_server.py Activity 7, Ex 1 Deliberately insecure single-threaded HTTP server — the starting point to be hardened (also printed in full in the book)
exif-sample.jpg Activity 9, Ex 1 JPEG photo with embedded GPS EXIF metadata
disk-sample.zip Activity 9, Ex 2 ZIP archive containing a FAT32 partition image with a deleted file for TestDisk recovery (extract with unzip to get disk.img)
victim-2020 Activity 11, Ex 3 ELF 64-bit Linux binary with an intentional buffer-overflow vulnerability

To download from the command line:

curl -O https://www.cp.eng.chula.ac.th/~krerk/books/ComputerSecurity/files/simple_web_server.py
curl -O https://www.cp.eng.chula.ac.th/~krerk/books/ComputerSecurity/files/exif-sample.jpg
curl -O https://www.cp.eng.chula.ac.th/~krerk/books/ComputerSecurity/files/disk-sample.zip
curl -O https://www.cp.eng.chula.ac.th/~krerk/books/ComputerSecurity/files/victim-2020
chmod +x victim-2020   # make the binary executable

Student supplements Available

Free study aids that accompany the book. Reproduce and adapt them for non-commercial classroom use, with attribution.

Item Used with Description
Activity handouts (8) The labs Each class activity as a standalone printable sheet.
Study guide All chapters Learning objectives, key terms and self-check questions (with answers), separate from the book exercises.
Reference cards (4) Quick recall Crypto primitives · attack taxonomy · forensics commands · network/scanning flags.
Lab environment Activities 2–13 A pinned Docker/Vagrant image that runs the activities out of the box.

All four are bundled in one archive: student-package.zip — or download items individually once posted.

For Instructors

Instructor package By request

Adopting this book for a course? An instructor package is available on request. It includes:

  • Lecture slide decks — one per chapter, as PDF and editable LaTeX source
  • Course maps and a sample syllabus — 15-week and 10-week schedules, prerequisite graph, assessment split
  • Lab setup guide — how to make each activity run, including the buffer-overflow toolchain and a legal scan target

Slides may be adapted and presented for non-commercial classroom instruction, with attribution. Exercise solutions and the test bank are supplied only to instructors who ask for them, and are not for redistribution. Full terms travel with the package.

Request the instructor package

Use your institutional email address. The download link appears as soon as you submit the form, and a copy is emailed to you; requests from other domains are passed to the author for approval. If the form does not work, write instead.

See where the book is being adopted, and choose whether your course is listed.

About the Author

Krerk Piromsopa, Ph.D.

Krerk Piromsopa, Ph.D.

Associate Professor — ดร. เกริก ภิรมย์โสภา

Associate Professor in the Department of Computer Engineering, Faculty of Engineering, Chulalongkorn University, Bangkok, Thailand.

Dr. Piromsopa received his B.Eng. and M.Eng. from Chulalongkorn University and his Ph.D. from Michigan State University. His research interests span computer security, computer architecture, and hardware-based security mechanisms, including the Secure Bit architecture for buffer-overflow prevention described in this book. He has taught computer security at the undergraduate and graduate levels for over twenty years.