Computer Science › Software + Distributed Computing

Security & Cryptography

0 of 16
  1. Authentication vs. Authorization

    Authentication answers "who are you"; authorization answers "what are you allowed to do" — two genuinely separate questions a system can get right on one axis while failing catastrophically on the other, plus mandatory vs. discretionary access control as two different answers to who gets to grant permissions in the first place.

    Read →6 sections11 min
  2. Threat Modeling with STRIDE

    A systematic way to ask "what could go wrong" before writing a line of code — six attacker-goal categories, Spoofing/Tampering/Repudiation/Information disclosure/Denial of service/Elevation of privilege, walked concretely against a small login feature.

    Read →6 sections11 min
  3. Perfect Secrecy and the One-Time Pad

    XOR a message with a truly random key exactly as long as the message, use that key exactly once, and the result is mathematically proven unbreakable — Shannon's perfect secrecy, and the two impractical conditions, true randomness and single use, that keep the one-time pad from being how any real system actually encrypts.

    Read →6 sections11 min
  4. Block Ciphers and Modes of Operation

    AES encrypts one fixed-size block at a time; a mode of operation is the separate, independent rule for stitching many blocks into a real message — and ECB, the naive mode, leaks every repeated block of plaintext in the ciphertext, the famous "ECB penguin", which is exactly why CBC and CTR exist.

    Read →6 sections11 min
  5. Cryptographic Hash Functions

    Preimage resistance, second-preimage resistance, and collision resistance are the three properties SHA-256 promises — a genuinely different, much stronger contract than the hash functions already covered for hash tables, which only ever promised speed and a low collision rate, never resistance to a deliberate, computationally-bounded attacker.

    Read →6 sections12 min
  6. Message Authentication and Authenticated Encryption

    Encryption alone hides a message's content but says nothing about whether it was tampered with in transit — a MAC built from a hash function (HMAC) adds an integrity guarantee, and authenticated encryption (AEAD) bundles confidentiality and integrity into one primitive so a program can't accidentally use one without the other.

    Read →6 sections12 min
  7. Modular Arithmetic for Public-Key Cryptography

    Every public-key scheme in this discipline is built on a small, fixed set of facts about arithmetic modulo a prime — modular exponentiation, multiplicative inverses via the extended Euclidean algorithm, and Fermat's little theorem — already covered as pure number theory, now doing the actual work of encryption.

    Read →6 sections11 min
  8. Diffie-Hellman Key Exchange

    Two parties who have never met and share no secret can agree on one in full view of an eavesdropper who sees every message — a worked example with small, real numbers, and the discrete logarithm problem that makes recovering the shared secret from the public exchange computationally hard.

    Read →6 sections11 min
  9. RSA Public-Key Cryptography

    A full worked key-generation, encryption, and decryption example with genuinely small primes — small enough to compute by hand, and explicitly nowhere near the 2048-bit primes a real deployment requires — built directly on Fermat's little theorem and the modular inverses already covered.

    Read →6 sections11 min
  10. Digital Signatures and Certificates

    Signing with RSA is encryption run in reverse — the private key proves authorship, the public key lets anyone verify it — and a certificate is just a trusted third party's own digital signature vouching that a given public key really belongs to the name printed on it.

    Read →6 sections11 min
  11. Memory-Safety and Injection Vulnerabilities

    A stack buffer overflow, already covered as a memory bug, and a SQL injection are structurally the exact same mistake surfacing in two different layers of a system — untrusted input treated as if it could never be anything but inert data, when in both cases it can be crafted to be interpreted as code or commands instead.

    Read →6 sections10 min
  12. Control-Hijacking Defenses

    Stack canaries, non-executable memory (W^X / DEP), and address-space layout randomization each close off one specific step of the classic buffer-overflow-to-code-execution attack — and no single one is a complete fix by itself, which is exactly why real systems layer all three and attackers still occasionally get past them with techniques like return-oriented programming.

    Read →6 sections11 min
  13. Web Security Fundamentals: XSS and CSRF

    Cross-site scripting smuggles an attacker's JavaScript into a page another user trusts; cross-site request forgery tricks a logged-in user's own browser into sending a request the attacker chose — two different vulnerability classes that both exploit the same underlying fact, that a browser attaches a user's cookies to a request regardless of which site asked for it.

    Read →6 sections11 min
  14. Network Security and Firewalls

    A firewall enforces a policy about which packets are allowed to cross a boundary at all — a genuinely earlier line of defense than anything else covered in this discipline, which mostly assumed an attacker's traffic had already been allowed to arrive.

    Read →6 sections10 min
  15. Capstone: Tracing a TLS Handshake

    Every primitive covered in this discipline — Diffie-Hellman key exchange, RSA/certificate-based authentication, AES in an authenticated mode, and a hash function inside an HMAC — working together, step by step, in the exact protocol that secures the padlock icon in a browser's address bar.

    Read →6 sections11 min

Security & Cryptography

Part of the Computer Science curriculum.

Sort
1

Security Goals and the CIA Triad

Confidentiality, integrity, and availability as the three properties any security mechanism is ultimately built to protect — and why a system that trades away one to strengthen another has usually made a real, sometimes entirely correct, engineering tradeoff rather than a mistake.

2

Authentication vs. Authorization

Authentication answers "who are you"; authorization answers "what are you allowed to do" — two genuinely separate questions a system can get right on one axis while failing catastrophically on the other, plus mandatory vs. discretionary access control as two different answers to who gets to grant permissions in the first place.

3

Threat Modeling with STRIDE

A systematic way to ask "what could go wrong" before writing a line of code — six attacker-goal categories, Spoofing/Tampering/Repudiation/Information disclosure/Denial of service/Elevation of privilege, walked concretely against a small login feature.

4

Perfect Secrecy and the One-Time Pad

XOR a message with a truly random key exactly as long as the message, use that key exactly once, and the result is mathematically proven unbreakable — Shannon's perfect secrecy, and the two impractical conditions, true randomness and single use, that keep the one-time pad from being how any real system actually encrypts.

5

Block Ciphers and Modes of Operation

AES encrypts one fixed-size block at a time; a mode of operation is the separate, independent rule for stitching many blocks into a real message — and ECB, the naive mode, leaks every repeated block of plaintext in the ciphertext, the famous "ECB penguin", which is exactly why CBC and CTR exist.

6

Cryptographic Hash Functions

Preimage resistance, second-preimage resistance, and collision resistance are the three properties SHA-256 promises — a genuinely different, much stronger contract than the hash functions already covered for hash tables, which only ever promised speed and a low collision rate, never resistance to a deliberate, computationally-bounded attacker.

7

Message Authentication and Authenticated Encryption

Encryption alone hides a message's content but says nothing about whether it was tampered with in transit — a MAC built from a hash function (HMAC) adds an integrity guarantee, and authenticated encryption (AEAD) bundles confidentiality and integrity into one primitive so a program can't accidentally use one without the other.

8

Modular Arithmetic for Public-Key Cryptography

Every public-key scheme in this discipline is built on a small, fixed set of facts about arithmetic modulo a prime — modular exponentiation, multiplicative inverses via the extended Euclidean algorithm, and Fermat's little theorem — already covered as pure number theory, now doing the actual work of encryption.

9

Diffie-Hellman Key Exchange

Two parties who have never met and share no secret can agree on one in full view of an eavesdropper who sees every message — a worked example with small, real numbers, and the discrete logarithm problem that makes recovering the shared secret from the public exchange computationally hard.

10

RSA Public-Key Cryptography

A full worked key-generation, encryption, and decryption example with genuinely small primes — small enough to compute by hand, and explicitly nowhere near the 2048-bit primes a real deployment requires — built directly on Fermat's little theorem and the modular inverses already covered.

11

Digital Signatures and Certificates

Signing with RSA is encryption run in reverse — the private key proves authorship, the public key lets anyone verify it — and a certificate is just a trusted third party's own digital signature vouching that a given public key really belongs to the name printed on it.

12

Memory-Safety and Injection Vulnerabilities

A stack buffer overflow, already covered as a memory bug, and a SQL injection are structurally the exact same mistake surfacing in two different layers of a system — untrusted input treated as if it could never be anything but inert data, when in both cases it can be crafted to be interpreted as code or commands instead.

13

Control-Hijacking Defenses

Stack canaries, non-executable memory (W^X / DEP), and address-space layout randomization each close off one specific step of the classic buffer-overflow-to-code-execution attack — and no single one is a complete fix by itself, which is exactly why real systems layer all three and attackers still occasionally get past them with techniques like return-oriented programming.

14

Web Security Fundamentals: XSS and CSRF

Cross-site scripting smuggles an attacker's JavaScript into a page another user trusts; cross-site request forgery tricks a logged-in user's own browser into sending a request the attacker chose — two different vulnerability classes that both exploit the same underlying fact, that a browser attaches a user's cookies to a request regardless of which site asked for it.

15

Network Security and Firewalls

A firewall enforces a policy about which packets are allowed to cross a boundary at all — a genuinely earlier line of defense than anything else covered in this discipline, which mostly assumed an attacker's traffic had already been allowed to arrive.

16

Capstone: Tracing a TLS Handshake

Every primitive covered in this discipline — Diffie-Hellman key exchange, RSA/certificate-based authentication, AES in an authenticated mode, and a hash function inside an HMAC — working together, step by step, in the exact protocol that secures the padlock icon in a browser's address bar.