1/99
Flashcards on all the lectures
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
What is the definition of Message Integrity?
It ensures that a message received by one party was indeed sent by the other party without being tampered with by an intermediary (Mallory).
What is a Length Extension Attack?
An attack against Merkle-Damgård hash constructions (like MD5 and SHA-1) where an attacker can append extra commands to a hash chain without knowing the previous blocks' plaintext or the secret password, because the digest represents the last internal chaining state.
What is a Collision Attack vs. a Pre-image Attack?
Collision: Finding two different messages (m1 ≠ m2) that result in the same hash output.
Pre-image: Given a hash output h(m), finding the original input $m$.
What is the Merkle-Damgård construction?
A method for building hash functions where the input is padded and split into fixed-size blocks (e.g., 512 bits). The blocks are processed sequentially using an Initialization Vector (I.V.) and a compression function.
Why is an HMAC (Keyed-Hash Message Authentication Code) preferred over a standard hash for integrity?
HMAC uses a nested construction (SHA256((k ⊕ outer) || SHA256((k ⊕ inner) || m))). This structure prevents Length Extension attacks and is currently recommended for security.
What is Kerckhoffs's Principle?
A cryptosystem should be secure even if everything about the system (the algorithm) is public knowledge, except for the key.
How does a Caesar Cipher work, and why is it insecure?
It shifts every letter by a fixed number $k$ (e.g., A → C). It is insecure because it preserves the frequency of the source language (e.g., 'E' remains the most frequent symbol), making it vulnerable to frequency analysis.
What is a Vigènere Cipher?
A polyalphabetic substitution cipher that uses a keyword to apply a sequence of different Caesar shifts to the plaintext. It essentially consists of N Caesar ciphers, where N is the length of the keyword.
What are Transposition Ciphers?
Ciphers that rearrange (permute) the order of the plaintext symbols rather than substituting them (e.g., Columnar or Rail Fence ciphers). They preserve the original letter frequencies of the plaintext but change their positions.
What is the difference between a True Random Generator and a Pseudo-Random Generator (PRG)?
True Randomness: Derived from physical processes (e.g., lava lamps, thermal noise). Secure but slow and impractical.
PRG: Uses a small, truly random seed to generate a long sequence of bits that appears random. It is fast and practical.
What are the requirements for a One-Time Pad (OTP) to be perfectly secure?
The key must be truly random.
The key must be at least as long as the plaintext.
The key must never be reused.
What is the vulnerability of Key Reuse in One-Time Pads or Stream Ciphers?
If two messages (p1, p2) are encrypted with the same key (k), XORing the two ciphertexts eliminates the key: (p1 ⊕ k) ⊕ (p2 ⊕ k) = p1 ⊕ p2. This allows attackers to recover the plaintext.
What are Confusion and Diffusion?
Confusion: Every bit of ciphertext should depend on several parts of the key (obscuring the relationship between key and ciphertext).
Diffusion: Changing 1 bit of the plaintext should change ~50% of the ciphertext bits (spreading the plaintext influence throughout the output).
What is a Stream Cipher?
A cipher that uses a Pseudo-Random Generator (PRG) seeded by a shared key to produce a keystream. This keystream is XORed with the plaintext to create ciphertext, similar to a One-Time Pad but practical.
What is a Block Cipher?
Concept: A symmetric key cipher that operates on fixed-length groups of bits called blocks (e.g., 64 or 128 bits).
Mechanism: It processes blocks using a reversible, non-colliding function and a secret key.
Padding: If a message isn't a multiple of the block size, padding is appended to the end.
What is Electronic Codebook (ECB) mode?
Operation: A block cipher mode where each block of plaintext is encrypted independently with the same key.
Pros: Fast and parallelizable.
Cons: Identical plaintext blocks produce identical ciphertext blocks, leading to low diffusion (patterns are visible, like the Linux penguin image).
What is Cipher Block Chaining (CBC) mode?
Operation: A block cipher mode where each block of plaintext is XORed with the previous ciphertext block before encryption. The first block uses an Initialization Vector (IV).
Pros: High diffusion; identical plaintext blocks produce different ciphertexts.
Cons: Sequential processing means it cannot be parallelized (slower).
Define Confusion and Diffusion
Confusion: The relationship between the key and the ciphertext should be obscured; every ciphertext bit depends on multiple parts of the key.
Diffusion: Spreading the influence of the plaintext across the ciphertext; changing one plaintext bit should change ~50% of the ciphertext bits.
What is a Transposition Cipher?
Concept: A cipher that rearranges the order of plaintext symbols rather than substituting them.
Example: Columnar Transposition (writing message in rows, reading out columns based on a keyword).
Weakness: It preserves the letter frequencies of the original language, making it vulnerable to frequency analysis.
What is Asymmetric Cryptography (Public Key)?
Concept: A cryptographic system using pairs of keys: a public key for encryption/verification and a private key for decryption/signing.
Benefit: Solves the key distribution problem by allowing secure communication without pre-sharing a secret key.
How does Diffie-Hellman Key Exchange work?
Goal: Securely exchange a shared secret over a public channel.
Mechanism:
Agree on public parameters p (large prime) and g (generator).
Alice sends gA mod p; Bob sends gB mod p (where A , B are private secrets).
Both compute shared secret gAB mod p.
Security: Relies on the Discrete Logarithm Problem.
What is RSA?
Concept: A public-key cryptosystem based on the difficulty of factoring the product of two large prime numbers.
Keys: Public key (e,N) and Private key (d,N), where N = p x q.
Usage:
Encryption: C = Me mod N (using recipient's public key).
Signing: S = Md mod N (using sender's private key).
What is the Bleichenbacher Attack?
Target: RSA digital signatures with small public exponents (e.g., e = 3) and insecure padding implementation.
Mechanism: If the implementation doesn't check the full padding, an attacker can forge a signature by constructing a message that is a perfect cube of the target hash, allowing forgery without the private key.
What are the Key Management Rules?
Single Purpose: Use different keys for signing, encryption, distinct protocols, etc.
Rotation: Change keys periodically; reuse increases vulnerability.
Storage: Keep keys away from attackers (e.g., use Hardware Security Modules).
Forward Secrecy: Compromise of an old key should not compromise future keys.
What is a Distributed Ledger (Blockchain)?
Concept: A decentralized record of all transactions shared across a network, eliminating the need for a central bank.
Structure: Transactions are chained together. To verify a balance, one must traverse the transaction history.
How does Bitcoin ensure transaction authenticity?
Mechanism: Users sign transactions with their private key.
Validation: The network verifies the signature using the user's public key (wallet address), ensuring only the owner of the funds can spend them.
What is the Double Spending problem and how is it solved?
Problem: A malicious user tries to spend the same digital coin twice or create a fake ledger.
Solution: Distributed Consensus (Proof-of-Work). It is computationally expensive to rewrite the ledger. If ledgers conflict, the network accepts the "longest" chain (most work).
What are the four main segments of process memory?
Text: Read-only, stores the executable code instructions.
Data: Stores global and static variables (initialized and uninitialized).
Heap: Dynamically allocated memory (grows upward/to higher addresses).
Stack: Local variables and function control flow (grows downward/to lower addresses).
In x86 architecture, what is the purpose of the EIP register?
The Extended Instruction Pointer. It stores the address of the next instruction to be executed. An attacker controlling EIP controls the CPU.
What is the difference between ESP and EBP?
ESP (Stack Pointer): Points to the top of the stack (the lowest address in the stack frame). It changes constantly as items are pushed/popped.
EBP (Base Pointer): Points to the base (bottom) of the current stack frame. It remains static during a function's execution and is used to reference local variables and arguments.
What happens to the stack during a function call?
Arguments are pushed onto the stack.
The Return Address (the address of the instruction after the call) is pushed onto the stack.
The old EBP is pushed to save the previous frame's context.
ESP is moved to EBP to start the new frame.
What does the strcpy function do, and why is it dangerous?
It copies a string from a source to a destination buffer. It is unsafe because it does not check if the destination buffer is large enough to hold the source string, leading to buffer overflows.
What is a Stack-based Buffer Overflow?
A vulnerability where a program writes more data to a buffer on the stack than it can hold. The excess data overwrites adjacent memory, potentially corrupting the Saved Frame Pointer (EBP) and the Return Address (EIP).
What is Shellcode?
A small piece of machine code (payload) used as the malicious output of an exploit. It is typically injected into memory during a buffer overflow to spawn a shell (command line) or execute arbitrary commands.
What is a NOP Sled (or NOP Slide)?
A sequence of "No Operation" (0x90) instructions placed before the shellcode. It increases the exploit's reliability; if the attacker jumps anywhere into the NOP sled, the CPU "slides" down until it hits and executes the shellcode.
How does an attacker redirect control flow?
By overwriting the Return Address on the stack with the memory address of their malicious code (or a NOP sled). When the function attempts to ret (return), it pops this malicious address into EIP and executes the attacker's code.
What is the purpose of Padding in an exploit payload?
Padding is junk data used to fill the space between the start of the buffer and the target data (like the Saved EIP). It ensures the malicious return address aligns perfectly with the location of the actual return address on the stack.
What is a Stack Canary?
A sacrificial value placed on the stack between the local variables (buffer) and the control data (EBP/EIP).
Check: Before a function returns, it checks if the canary value has changed.
Result: If the canary is modified (by an overflow), the program detects the attack and terminates immediately ("Segfault") before the return address is used.
What is W^X (Write XOR Execute) or DEP/NX?
A security feature that marks memory pages as either Writeable or Executable, but never both.
Effect: It prevents an attacker from executing shellcode injected into the Stack or Heap (which are writeable), because those regions are marked as non-executable.
What is ASLR (Address Space Layout Randomization)?
A defense that randomizes the memory locations of key data areas (stack, heap, libraries) every time a program runs.
Effect: It makes it difficult for attackers to jump to specific addresses (like their shellcode or system functions) because they don't know where they are located in memory.
What is AddressSanitizer (ASan)?
A compile-time instrumentation tool that detects memory errors. It adds "red zones" (poisoned memory) around objects. If a program tries to access a red zone (indicating an overflow), ASan crashes the program to prevent corruption.
What is Fuzzing?
An automated testing technique that involves providing invalid, unexpected, or random data as inputs to a computer program to monitor it for crashes (e.g., segmentation faults) or other bugs.
What is the difference between Mutation-based and Generation-based fuzzing?
Mutation-based: Modifies existing valid inputs (seeds) using operations like bit-flipping, byte-swapping, or arithmetic changes. (Example: AFL).
Generation-based: Creates inputs from scratch based on a specification or grammar of the input format. (Example: Peach Fuzzer).
What is Coverage-guided Fuzzing?
A fuzzing strategy that instruments the target program to track which code paths are executed. It saves inputs that discover new code paths to use as seeds for future mutations, aiming to maximize code coverage.
What is the "trade-off" in fuzzing?
The balance between Performance (executions per second) and Precision (depth/quality of analysis). Simple fuzzers are fast but shallow; complex fuzzers (like symbolic execution) are deep but slow.
What is the Principle of Least Privilege?
A security concept where a user or process is granted only the minimum levels of access—or permissions—necessary to perform its job function.
What is Discretionary Access Control (DAC)?
An access control model where the owner of a resource decides who has access to it. (e.g., Unix file permissions: chmod 777).
What is Mandatory Access Control (MAC)?
An access control model where a central policy (defined by administrators) dictates access rights based on security labels (e.g., "Confidential", "Top Secret"). Users cannot override these policies. (e.g., SELinux).
What is the difference between a Virtual Machine (VM) and a Container?
VM: Virtualizes the hardware. It runs a full Guest OS on top of a Hypervisor. Provides strong isolation but has high overhead.
Container: Virtualizes the OS. It shares the Host OS kernel but isolates user-space (processes, filesystem). Provides lightweight isolation but a larger attack surface (shared kernel).
What is Sandboxing?
A security mechanism for separating running programs, usually to execute untested or untrusted code without risking harm to the host machine or operating system. (e.g., Chromium Sandbox, Google Native Client).
What is a Virus?
Malicious code that attaches itself to a host program or file. It requires user interaction (like opening a file) to replicate and spread.
What is a Worm?
Standalone malicious software that replicates itself to spread to other computers. Unlike a virus, it does not need to attach to a host program or require user action to propagate (it spreads via networks).
What is a Trojan Horse?
Malware that disguises itself as legitimate or useful software to trick users into installing it. Once installed, it executes malicious actions (e.g., stealing data, installing backdoors).
What is Ransomware?
A type of malware that encrypts a victim's data and demands payment (ransom) for the decryption key. (e.g., CryptoLocker, WannaCry).
What is a Rootkit?
Malicious software designed to hide the existence of malware or unauthorized access on a system. It often operates at the kernel level (Ring 0) to subvert OS visibility tools (like hiding processes or files).
What is a Botnet?
A network of compromised computers ("zombies" or "bots") controlled by a central attacker ("botmaster"). They are often used for DDoS attacks or spam campaigns.
What is the difference between Static Analysis and Dynamic Analysis for malware detection?
Static: Analyzing the code/file without running it (e.g., signature matching, reverse engineering). Safe but can be obfuscated.
Dynamic: Analyzing the behavior of the code while it runs (e.g., in a sandbox). Can detect behavior but is slower and risky.
What are the roles of HTML, CSS, and JavaScript?
HTML: Structure and content of the page.
CSS: Styling and layout (presentation).
JavaScript: Interactivity and logic (client-side execution).
What is the difference between GET and POST requests?
GET: Used to retrieve data. Parameters are sent in the URL. Idempotent (safe to repeat).
POST: Used to submit data (create/update). Parameters are sent in the body. Not idempotent.
What is SQL Injection (SQLi)?
An attack where malicious SQL statements are inserted into entry fields for execution (e.g., dumping the database contents to the attacker). It occurs when user input is concatenated directly into a query string.
How do you prevent SQL Injection?
Prepared Statements (Parameterized Queries): The database treats user input as data, not executable code.
Input Sanitization: Removing or escaping dangerous characters (though less effective than prepared statements).
What is Cross-Site Request Forgery (CSRF)?
An attack that forces an authenticated user to execute unwanted actions on a web application in which they are currently logged in (e.g., transferring funds, changing a password) without their knowledge.
How do CSRF Tokens prevent CSRF attacks?
The server issues a unique, unpredictable token to the client. This token must be included in state-changing requests (like POST). Since the attacker cannot read the user's token (due to Same-Origin Policy), they cannot forge a valid request.
What is Cross-Site Scripting (XSS)?
A vulnerability where an attacker injects malicious scripts into a trusted website. When other users view the site, the script executes in their browser, allowing the attacker to steal cookies or session tokens.
What is the difference between Reflected XSS and Stored XSS?
Reflected: The malicious script comes from the current HTTP request (e.g., a link with a payload in the URL). It affects the user who clicks the link.
Stored: The malicious script is stored on the server (e.g., in a comment or forum post). It affects every user who views the stored content.
What is Content Security Policy (CSP)?
A browser security layer that helps detect and mitigate XSS. It allows site administrators to declare approved sources of content (e.g., "only allow scripts from my domain"), preventing the execution of unauthorized injected scripts.
What is the Same-Origin Policy (SOP)?
A critical browser security mechanism that restricts how a document or script loaded from one origin (domain, protocol, port) can interact with a resource from another origin. It prevents a malicious site from reading data from a banking site open in another tab.
What are the three main security goals of HTTPS?
Confidentiality: Encrypting data so eavesdroppers cannot read it.
Integrity: Ensuring data hasn't been modified in transit.
Authenticity: Verifying that you are communicating with the intended server (preventing MITM).
What is the role of a Certificate Authority (CA)?
A trusted third-party entity that issues digital certificates. They verify the identity of the certificate owner (e.g., that Google really owns google.com) and sign the certificate so browsers can trust it.
What is the TLS Handshake?
The process used by the client and server to establish a secure connection. They negotiate the cipher suite, authenticate the server (via certificate), and generate session keys for encryption.
What is an SSL Stripping attack?
A Man-in-the-Middle attack where the attacker intercepts the initial HTTP connection and prevents the upgrade to HTTPS, forcing the victim's browser to communicate in plain text (HTTP) while the attacker proxies the traffic to the server via HTTPS.
What is HSTS (HTTP Strict Transport Security)?
A web security policy mechanism that forces browsers to interact with a website only using secure HTTPS connections (and never HTTP). It defends against SSL stripping attacks.
What do the Secure and HttpOnly cookie flags do?
Secure: The cookie is only sent over encrypted (HTTPS) connections.
HttpOnly: The cookie cannot be accessed by client-side APIs (like JavaScript document.cookie), protecting it from XSS theft.
What is the OSI Model, and what are its 7 layers?
A conceptual framework used to describe the functions of a networking system.
Physical: Raw bit transmission (cables, Wi-Fi).
Data Link: Transfer between adjacent network nodes (Ethernet, MAC addresses).
Network: Routing data between different networks (IP).
Transport: End-to-end communication and reliability (TCP, UDP).
Session: Managing sessions between applications.
Presentation: Data translation and encryption (SSL/TLS often mapped here).
Application: Network services for end-users (HTTP, DNS, SMTP).
What is Encapsulation?
The process of wrapping data from a higher layer protocol with headers (and sometimes trailers) from a lower layer protocol. For example, an HTTP request is wrapped in a TCP segment, which is wrapped in an IP packet, which is wrapped in an Ethernet frame.
What is the difference between a Switch and a Router?
Switch: Operates at Layer 2 (Data Link). Connects devices within a single network (LAN) using MAC addresses.
Router: Operates at Layer 3 (Network). Connects multiple networks together (WAN) and directs traffic using IP addresses.
What is ARP (Address Resolution Protocol)?
A protocol used to map an IP address (Layer 3) to a physical MAC address (Layer 2). When a device wants to send a packet to a local IP, it broadcasts an ARP request ("Who has IP X?") to find the destination's MAC address.
What is DNS (Domain Name System)?
The "phonebook" of the internet. It translates human-readable domain names (like google.com) into IP addresses (like 142.250.190.46) that computers use to identify each other on the network.
What is ARP Spoofing (or ARP Poisoning)?
A local network attack where an attacker sends fake ARP messages. This links the attacker's MAC address with the IP address of a legitimate device (like the default gateway), allowing the attacker to intercept, modify, or stop data frames intended for that IP (Man-in-the-Middle).
What is DNS Spoofing (or DNS Cache Poisoning)?
An attack where corrupt DNS data is introduced into the cache of a DNS resolver. This causes the resolver to return an incorrect IP address for a domain, redirecting users to a malicious website instead of the legitimate one.
What is a Man-in-the-Middle (MITM) attack?
An attack where the attacker secretly relays and possibly alters the communication between two parties who believe they are directly communicating with each other.
What is a Denial of Service (DoS) attack?
An attack aimed at making a machine or network resource unavailable to its intended users by temporarily or indefinitely disrupting services of a host connected to the internet.
What is a Distributed Denial of Service (DDoS) attack?
A DoS attack where the incoming traffic flooding the victim originates from many different sources (often a botnet). This makes it impossible to stop the attack simply by blocking a single source.
What is a SYN Flood attack?
A DoS attack that exploits the TCP handshake. The attacker sends a flood of SYN packets (connection requests) but never sends the final ACK. The server allocates resources for these half-open connections until it runs out of memory/slots and stops accepting legitimate connections.
What is a Reflection/Amplification attack?
An attack where the attacker sends requests to a third-party server (reflector) using a spoofed source IP address (the victim's IP). The server sends the response to the victim.
Amplification: The response is significantly larger than the request (e.g., DNS or NTP), magnifying the volume of traffic hitting the victim.
What are the three factors of authentication?
Something you know: Password, PIN, answer to a security question.
Something you have: Physical key, smart card, phone (for 2FA).
Something you are: Biometrics (fingerprint, iris scan, face ID).
How should passwords be stored securely?
Never in plaintext.
Hashing: Use a slow, cryptographic hash function (like bcrypt, scrypt, Argon2) to prevent reversibility.
Salting: Add a unique, random value (salt) to each password before hashing to prevent Rainbow Table attacks and ensure identical passwords have different hashes.
What is a Rainbow Table attack?
A precomputed table of hash values for every possible password (up to a certain length). It allows attackers to reverse hashes very quickly by looking them up in the table instead of brute-forcing them one by one. Salting defeats this.
What is Phishing?
A social engineering attack where an attacker masquerades as a trusted entity (via email, SMS, or fake website) to trick a victim into revealing sensitive information like login credentials or financial details.
What is Credential Stuffing?
An attack where automated scripts try username/password pairs stolen from one data breach on many other websites, exploiting the tendency of users to reuse passwords across multiple services.
What is Tor (The Onion Router)?
A network designed to enable anonymous communication. It directs internet traffic through a free, worldwide, volunteer overlay network consisting of more than seven thousand relays to conceal a user's location and usage from anyone conducting network surveillance or traffic analysis.
How does Onion Routing work?
Data is encapsulated in layers of encryption, like the layers of an onion. The data path is built through a series of relays (Entry, Middle, Exit). Each relay decrypts one layer to uncover the next relay's address, sending the packet forward without knowing the full path (source or final destination).
What does the Entry Guard (or Guard Node) know?
It knows the client's IP address (who is connecting) but not the content of the traffic or the final destination (website).
What does the Exit Node know?
It knows the destination website and the content of the traffic (if unencrypted HTTP), but not the client's IP address (who sent it). It is the point where traffic leaves the Tor network and enters the regular internet.
What is the Sybil Attack in the context of Tor?
An attack where a single adversary creates a large number of pseudonymous identities (nodes/relays) to gain a disproportionately large influence on the network. If an attacker controls both the entry and exit nodes of a circuit, they can potentially de-anonymize the user through traffic correlation.
What is Traffic Analysis?
An attack method where an adversary observes the pattern of network traffic (timing, volume, packet size) to deduce information, such as correlating traffic entering the Tor network with traffic leaving it to link a user to a destination, even without breaking the encryption.
What is a Side Channel Attack?
An attack that gathers information from the physical implementation of a system rather than exploiting a software bug or cryptographic weakness.
Examples: Timing, Power consumption, Electromagnetic radiation, Sound, Cache access patterns.
What is a Timing Attack?
An attack where the attacker infers secret information (like a cryptographic key) by measuring how long it takes for the system to execute cryptographic algorithms. (e.g., if statements that take different times depending on a key bit).
What is a Power Analysis Attack?
An attack that monitors the power consumption of a hardware device (like a smart card) while it performs encryption. Different operations (like processing a '0' vs a '1') consume different amounts of power, leaking the key.
What is a Hardware Trojan?
A malicious modification to a chip's circuitry inserted during the manufacturing process. It can be designed to leak information, disable the device, or grant backdoor access, and is extremely difficult to detect after fabrication.