




































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





































































All 7 Units | Detailed Definitions | Real-Life Examples | Exam Tips | Key Formulas Unit Topic Hours Unit 1 Attacks on Computers & Computer Security 5 Hrs Unit 2 Cryptography: Concepts & Techniques - Part 1 7 Hrs Unit 3 Symmetric Key Algorithm (DES, IDEA, RC5) 8 Hrs Unit 4 Asymmetric Key Algorithm, Digital Signature & RSA 5 Hrs Unit 5 Internet Security Protocols & User Authentication 6 Hrs Unit 6 Electronic Mail Security 4 Hrs Unit 7 Firewall & DMZ Network 3 Hrs
Attacks on Computers & Computer Security 5 Hrs Duration 1.1 Introduction to Computer Security Definition: Computer Security Computer Security is defined as the protection of computer systems, networks, programs, and data from digital attacks, unauthorized access, damage, theft, or any other form of misuse. It is the practice of establishing and maintaining a secure computing environment that ensures confidentiality, integrity, and availability of information assets. Computer security encompasses both hardware and software security mechanisms, administrative policies, and physical safeguards that work together to protect information systems from harm. Computer security is not just about installing an antivirus program. It is a broad, multi-disciplinary field that deals with threats coming from hackers, malware, disgruntled employees, natural disasters, and even accidental human errors. Every device connected to the internet - from a smartphone to a hospital server - requires a well-defined security strategy to function safely. Real-Life Example Consider your online banking account. The bank uses computer security to: (1) verify your identity when you log in using a password and OTP - this is Authentication; (2) ensure nobody can intercept and read your account details as they travel over the internet - this is Confidentiality via Encryption; (3) ensure your account balance is not secretly modified by anyone - this is Integrity; and (4) ensure the banking website is always available 24x7 - this is Availability. Taken together, these form the core of computer security. 1.2 Need for Security The need for computer security has grown exponentially with our increasing dependence on digital systems. Below are the primary reasons why security is an absolute necessity in modern computing:
Organizations and individuals store enormous amounts of sensitive information on computer systems - including financial records, medical data, personal identification details, trade secrets, and government intelligence. Without proper security, this data is vulnerable to theft, exposure, or manipulation. A single data breach can compromise the privacy of millions of people, as seen in numerous real-world incidents involving large corporations and governments.
Detection refers to mechanisms designed to identify when a security breach or attack is occurring or has occurred. Since prevention alone cannot stop all attacks, detection provides a second line of defense. Detection tools include Intrusion Detection Systems (IDS), security logs and audit trails, antivirus scanners, security information and event management (SIEM) systems, and network monitoring tools. Early detection limits the damage caused by an attack.
Recovery refers to the processes that allow an organization to restore normal operations after a security incident. Recovery mechanisms include data backups, disaster recovery plans, business continuity planning, incident response procedures, and forensic analysis to understand what happened and prevent recurrence. A strong recovery plan ensures that even if an attack succeeds, the damage is minimized and operations resume quickly. Real-Life Example Think of security like protecting your house. Prevention = installing strong locks, alarms, and security cameras. Detection = the alarm system going off when an intruder enters. Recovery = having insurance, replacing stolen items, and adding better locks afterward. All three are essential - a house with only locks but no alarm and no insurance plan is still vulnerable. 1.4 Principles of Security (CIA Triad + Extended) The foundational framework of computer security is built on three core principles, collectively known as the CIA Triad. These three properties - Confidentiality, Integrity, and Availability - define the security goals for any information system. Every security mechanism and policy is designed to uphold one or more of these principles.
Definition: Confidentiality Confidentiality is the security principle that ensures information is accessible only to those who are authorized to access it. It protects data from being read, viewed, or disclosed to unauthorized individuals, processes, or systems. Confidentiality is achieved through mechanisms such as encryption, access control, authentication, and data classification policies. Confidentiality is violated when sensitive information is exposed to unauthorized parties - for example, when a hacker intercepts and reads private messages, or when an employee accesses files they are not authorized to view. Techniques to ensure confidentiality include: data encryption (scrambling data so only authorized users can read it), user authentication (verifying identity before granting access), authorization controls (limiting what each user can see and do), and physical security measures (preventing unauthorized physical access to systems).
Real-Life Example When you type your credit card number on a shopping website, the number is encrypted using TLS/SSL before being sent over the internet. Only the bank's server, which holds the correct decryption key, can read it. Your card number remains confidential even as it travels across thousands of internet routers.
Definition: Integrity Integrity is the security principle that ensures data remains accurate, consistent, and unaltered during storage, transmission, and processing. It guarantees that information is modified only by authorized entities and through authorized processes. Integrity is violated when data is accidentally or maliciously changed without authorization. Integrity is concerned with trustworthiness of data. Even if data remains confidential (hidden from unauthorized users), it is useless if it cannot be trusted to be accurate. Integrity violations can be intentional (a hacker modifying a financial transaction) or accidental (data corruption due to hardware failure). Techniques to ensure integrity include: cryptographic hash functions (creating a digital fingerprint of data that changes if even one bit is modified), Message Authentication Codes (MACs), digital signatures, version control systems, and checksums. Real-Life Example Suppose you initiate a bank transfer of Rs.1,000 to a friend. If a Man-in-the-Middle attacker intercepts the transaction and changes the amount to Rs.1,00,000 before it reaches the bank's server, the integrity of the transaction has been violated. A digital signature or MAC on the transaction would detect this tampering, because the signature/hash computed by the attacker would not match the original.
Definition: Availability Availability is the security principle that ensures authorized users can access information and systems whenever they need to. It means that systems, services, and data are operational and accessible to legitimate users at the required times. Availability is violated when systems are made inaccessible - whether by a Denial-of-Service attack, hardware failure, natural disaster, or any other disruption. Availability is often overlooked but is just as critical as confidentiality and integrity. A hospital that cannot access patient records during an emergency, or an e-commerce website that goes down during a sale, suffers severe consequences. Techniques to ensure availability include: redundant hardware and network links (backup systems that take over if the primary fails), load balancing (distributing traffic across multiple servers), Denial-of-Service protection, regular system maintenance, disaster recovery planning, and uninterruptible power supplies (UPS).
Exam Tip The CIA Triad (Confidentiality, Integrity, Availability) appears in almost every exam. Be prepared to define each one clearly with an example. Also know: Authentication (who are you?), Authorization (what can you do?), Non-repudiation (can't deny your action). 1.5 Types of Attacks A security attack is any action that compromises the security of information or systems. Attacks are broadly classified into two categories based on the attacker's intent and behavior: Passive Attacks and Active Attacks. A. Passive Attacks Definition: Passive Attack A passive attack is an attack in which the attacker intercepts and monitors communications or data without modifying them. The attacker's goal is to gain unauthorized access to information by observing or listening, without disrupting normal system operations. Passive attacks are very difficult to detect because they leave no trace in the system - the data flows normally, but is being secretly read or recorded. Passive attacks violate Confidentiality - the attacker reads information they are not supposed to see, but does not alter it. Because the data and systems behave normally, the victim is usually unaware that an attack is taking place.
Eavesdropping is the unauthorized interception and reading of data as it travels across a network. An attacker places a packet sniffer - a software tool that captures all network traffic - at a strategic point on the network. The attacker then reads the captured packets to extract sensitive information such as usernames, passwords, emails, and financial data. Unencrypted protocols like HTTP, FTP, and Telnet are especially vulnerable to eavesdropping.
Traffic analysis is a more sophisticated passive attack in which the attacker observes the patterns of communication rather than the content of messages. Even when messages are encrypted and the attacker cannot read them, information can be gained by analyzing: who is communicating with whom, how frequently messages are exchanged, the size and timing of messages, and the source and destination of traffic. This information can reveal sensitive relationships, business activities, or military plans.
Real-Life Example Suppose a journalist is communicating with a whistleblower using encrypted messages. An attacker using traffic analysis notices that the journalist's computer exchanges very large, frequent messages with an unknown server right before a major news story breaks. Even without reading the messages, the attacker has learned that the journalist has a secret source - valuable intelligence from traffic analysis alone. Important Note Passive attacks are difficult to detect because they do not alter data or disrupt services. The primary defense against passive attacks is encryption - even if an attacker captures the data, they cannot read it without the decryption key. B. Active Attacks Definition: Active Attack An active attack is an attack in which the attacker actively interferes with communications, modifies data, disrupts services, or creates false data to achieve their malicious goals. Unlike passive attacks that only observe, active attacks involve some form of action by the attacker - inserting, deleting, modifying, or replaying data. Active attacks are generally easier to detect than passive attacks, but harder to prevent. Active attacks can violate all three properties of the CIA Triad - Confidentiality (by exposing data), Integrity (by modifying data), and Availability (by disrupting services). The following are the major types of active attacks:
Definition: Masquerade Attack A masquerade attack (also called an impersonation attack) is an active attack in which the attacker pretends to be a legitimate user or system in order to gain unauthorized access to resources. The attacker uses stolen credentials, forged identities, or fabricated authentication data to impersonate someone with higher privileges. The name comes from 'masquerade' - wearing a disguise to deceive others. Real-Life Example A cybercriminal sends a phishing email to an employee of a company, pretending to be the IT department. The email says: 'Your password is expiring. Click here to reset it.' The employee clicks the fake link, enters their credentials on a fake website that looks exactly like the company's login page, and the attacker captures those credentials. The attacker then uses those credentials to log into the real company system, masquerading as the employee.
packets directed at random ports), and HTTP Flood (sending a large number of HTTP requests to a web server, consuming all its resources).
Definition: Distributed Denial of Service (DDoS) Attack A Distributed Denial of Service attack is a DoS attack carried out simultaneously from a large number of compromised computers (called a botnet), all directed at a single target. Because the attack comes from many different sources, it is much harder to block than a regular DoS attack (you cannot just block one IP address). The attacker controls the botnet - a network of 'zombie' computers infected with malware - remotely and directs them all to attack the target simultaneously. Real-Life Example In October 2016, the Dyn DNS cyberattack - a massive DDoS attack - was launched using a botnet of millions of Internet of Things (IoT) devices (webcams, routers, smart home devices) infected with Mirai malware. The attack flooded Dyn's DNS servers with traffic, making major websites including Twitter, Netflix, Reddit, CNN, and GitHub unavailable for most of a day across the United States and Europe. This demonstrated how DDoS attacks can disrupt critical internet infrastructure.
Definition: Man-in-the-Middle (MITM) Attack A Man-in-the-Middle attack is an active attack in which the attacker secretly positions themselves between two communicating parties - intercepting, reading, and potentially modifying all communications that pass between them - while each party believes they are communicating directly and securely with the other. The attacker acts as a relay, forwarding messages between the two parties to avoid detection while gaining complete access to the conversation. Real-Life Example Alice wants to communicate securely with Bob. She sends her public key to Bob so they can set up encryption. But the attacker Eve intercepts Alice's public key and replaces it with her own public key before it reaches Bob. Now Bob encrypts messages with Eve's public key, thinking it is Alice's. Eve receives Bob's messages, decrypts them with her private key (reading everything), then re-encrypts them with Alice's real public key and forwards them to Alice. Both Alice and Bob think they are communicating securely with each other, but Eve is reading and potentially modifying every message. This is MITM. Attack Type Category What Is Violated Primary Goal Eavesdropping Passive Confidentiality Read secret data
Attack Type Category What Is Violated Primary Goal Traffic Analysis Passive Confidentiality Learn communication patterns Masquerade Active Authentication Gain unauthorized access Replay Active Authentication / Integrity Re-use valid credentials Message Modification Active Integrity Alter data in transit Denial of Service (DoS) Active Availability Disrupt services DDoS Active Availability Large-scale service disruption Man-in-the-Middle Active All three (CIA) Intercept and manipulate Exam Tip Passive vs Active is a very common exam question. Key distinction: Passive = only OBSERVE (no modification, hard to detect). Active = MODIFY or DISRUPT (easier to detect, harder to prevent). Always give examples with your answers.
ā CIA Triad = Confidentiality (only authorized access) + Integrity (no unauthorized modification) + Availability (always accessible when needed) ā Authentication = verifying identity | Authorization = verifying permissions | Non-repudiation = cannot deny action ā Passive Attack = eavesdropping, traffic analysis - violates CONFIDENTIALITY only ā Active Attack = masquerade, replay, modification, DoS, DDoS, MITM - violates INTEGRITY and/or AVAILABILITY ā DoS = single attacker floods a server | DDoS = botnet (many computers) floods a server simultaneously ā Replay attack = capturing valid data and resending it later without needing to decrypt it ā Masquerade = fake identity to impersonate a legitimate user
Term Detailed Definition / Explanation of a cryptographic system depends on the secrecy of the key, not just the algorithm. A longer, more random key provides stronger security. Cipher The specific algorithm or method used to perform encryption and decryption. Examples: Caesar cipher, Vigenere cipher, AES. A cipher defines the mathematical transformation applied to plaintext. Cryptanalysis (^) The science of analyzing and breaking cryptographic systems - i.e., attempting to recover the plaintext or the key without authorized access. Cryptanalysis is what adversaries (hackers) attempt to do. Cryptology The combined study of cryptography (creating secure systems) and cryptanalysis (breaking them). It is the broader field that encompasses both disciplines. Important Note The fundamental principle: Encryption Flow: Plaintext + Key - > [Encryption Algorithm] - > Ciphertext. Decryption Flow: Ciphertext + Key - > [Decryption Algorithm] - > Plaintext. The algorithm can be public (and often is), but the KEY must remain secret. Real-Life Example When you send a WhatsApp message, it is encrypted on your phone before transmission. WhatsApp uses end-to-end encryption, meaning only your phone (sender) and the recipient's phone hold the keys. Even WhatsApp's own servers cannot read your messages
number of positions (the key, K) ahead in the alphabet. Because of this fixed shifting, it is also called a Shift Cipher. Mathematical Formula: Encryption: C = (P + K) mod 26 | Decryption: P = (C - K + 26) mod 26 Where P = numerical value of plaintext letter (A=0, B=1, ... Z=25), C = numerical value of ciphertext letter, and K = the key (shift amount, between 1 and 25). Step-by-step Example (Key K = 3): Plaintext = HELLO H(7) - > (7+3) mod 26 = 10 - > K E(4) - > (4+3) mod 26 = 7 - > H L(11)-> (11+3) mod 26 = 14 - > O L(11)-> (11+3) mod 26 = 14 - > O O(14)-> (14+3) mod 26 = 17 - > R Result: Ciphertext = KHOOR Strengths of Caesar Cipher: Simple to understand and implement. Requires minimal computation. Sufficient for very low-security needs. Weaknesses of Caesar Cipher: Extremely weak by modern standards. Has only 25 possible keys (K=1 to 25). An attacker can try all 25 possible shifts (brute force attack) and find the correct one within seconds. Also vulnerable to frequency analysis. Real-Life Example If you receive an encrypted message 'KHOOR ZRUOG' and suspect it is a Caesar cipher, you try all 25 shifts. At shift K=3, you get 'HELLO WORLD'. With only 25 possibilities, this takes almost no time. This is why Caesar cipher provides zero real-world security. B. Monoalphabetic Cipher Definition: Monoalphabetic Cipher A Monoalphabetic Cipher is a substitution cipher in which each letter of the plaintext alphabet is mapped to a unique, fixed letter of the ciphertext alphabet. Unlike the Caesar cipher which uses a simple shift, a monoalphabetic cipher uses an arbitrary permutation of the alphabet as the key. The mapping is consistent throughout the entire message - the same plaintext letter always maps to the same ciphertext letter. Example Mapping (one possible key): Plaintext: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Ciphertext: Q W E R T Y U I O P A S D F G H J K L Z X C V B N M Using the above key: 'HELLO' - > 'ITSSG' (H->I, E->T, L->S, L->S, O->G) Key Space: There are 26! (26 factorial) ~= 4 x 10^26 possible monoalphabetic keys. This is an astronomically large number - far too many to try by brute force.
Plaintext Preparation Rules: Before encrypting, split plaintext into pairs. If a pair has identical letters, insert 'X' between them (e.g., 'BALLOON' - > 'BA LX LO ON'). If the total number of letters is odd, add an 'X' at the end. Advantages over Monoalphabetic: The Playfair cipher has 26x26 = 676 possible digrams (pairs) compared to just 26 single letters. This makes frequency analysis much harder because the attacker must analyze pair frequencies, which are far more evenly distributed than single letter frequencies. It was used by the British military in World War I and World War II. D. Vigenere Cipher Definition: Vigenere Cipher The Vigenere Cipher is a polyalphabetic substitution cipher that uses a repeating keyword to apply multiple different Caesar cipher shifts to different positions in the plaintext. It was described by Giovan Battista Bellaso in 1553 but misattributed to Blaise de Vigenere. For centuries it was considered unbreakable until Charles Babbage and Friedrich Kasiski independently developed methods to crack it in the 19th century. How It Works: Each letter of the plaintext is shifted by the amount corresponding to the matching letter of the keyword. The keyword repeats as many times as necessary to match the length of the plaintext. Formula: C[i] = (P[i] + K[i]) mod 26 | P[i] = (C[i] - K[i] + 26) mod 26 Example: Plaintext = 'ATTACKATDAWN', Key = 'LEMON' Plaintext: A T T A C K A T D A W N Key: L E M O N L E M O N L E (keyword repeats) Key values: 11 4 12 14 13 11 4 12 14 13 11 4 Ciphertext: L X F O P V E F R N H R Verification: A(0)+L(11)=11->L, T(19)+E(4)=23->X, T(19)+M(12)=31 mod 26=5->F Key Advantage over Monoalphabetic: The same plaintext letter is encrypted to different ciphertext letters depending on its position. For example, the letter 'A' at position 1 becomes 'L', but 'A' at position 4 becomes 'O'. This defeats simple frequency analysis because the frequency distribution of ciphertext letters does not directly correspond to plaintext letter frequencies. Weakness - Kasiski Test: If the keyword length is discovered, the Vigenere cipher reduces to multiple independent Caesar ciphers, each of which can be broken by frequency analysis. The Kasiski Test finds the keyword length by looking for repeated sequences of 3+ letters in the ciphertext. The distances between repeated sequences are likely to be multiples of the keyword length. Taking the GCD of these distances gives the probable keyword length. Real-Life Example
If the keyword length is 5, then positions 1, 6, 11, 16... are all encrypted with the same shift (the 1st keyword letter). Group those letters together and perform frequency analysis - the most common letter in that group is probably 'E' in the original message. Repeat for each of the 5 groups to recover all 5 keyword letters. Vigenere is thus not truly unbreakable. 2.3 Transposition Techniques Definition: Transposition Cipher A transposition cipher is an encryption technique in which the letters of the plaintext are rearranged (permuted) according to a specific pattern or key - but the letters themselves are NOT changed. The same letters appear in the ciphertext, just in a different order. Unlike substitution ciphers that change the identity of letters, transposition ciphers change the positions of letters. A. Rail Fence Cipher Definition: Rail Fence Cipher The Rail Fence Cipher is a simple transposition cipher in which the plaintext is written in a zigzag pattern across a number of 'rails' (rows), and then the rows are read off sequentially from top to bottom to produce the ciphertext. The number of rails is the key. Example: Plaintext = 'WEAREDISCOVERED', Number of Rails = 3 Rail 1: W... E... I... V... D Rail 2:. E. A. E. D. S. O. E. E. R Rail 3:.. R... C..... R..... Read each rail left to right: Rail1 = 'WEIVD', Rail2 = 'EAEDSOEER', Rail3 = 'RCR' Ciphertext = 'WEIVDEAEDSOEERCR' B. Columnar Transposition Cipher Definition: Columnar Transposition Cipher In a columnar transposition cipher, the plaintext is written row by row into a grid with a fixed number of columns (determined by the keyword length). The columns are then read off in the order defined by the alphabetical order of the keyword letters to form the ciphertext. The keyword determines both the number of columns and the order in which they are read. Example: Keyword = 'ZEBRAS' (6 letters, so 6 columns), Plaintext = 'WE ARE DISCOVERED FLEE AT ONCE' Step 1: Number the keyword letters in alphabetical order: Z=6, E=3, B=2, R=5, A=1, S= Step 2: Write plaintext row by row under the keyword: Key: Z E B R A S
Key Distribution Problem - The Major Challenge: The biggest drawback of symmetric key cryptography is the key distribution problem. Before two parties can communicate securely, they must somehow share a secret key. If they meet in person to exchange the key, this is not practical for internet communications. If they send the key over an insecure channel, an attacker could intercept it. This problem was one of the primary motivations for the development of asymmetric (public key) cryptography. Property Details Number of Keys (^) One shared secret key for both encryption and decryption Speed (^) Very fast - suitable for encrypting large amounts of data Computational Cost Low - simple mathematical operations (XOR, bit shifts, substitutions) Key Management Difficult - the key must be securely shared between parties before communication Scalability (^) Poor - for n users to all communicate privately, n(n-1)/2 keys are needed Examples DES (56-bit), 3DES, AES (128/192/256-bit), Blowfish, RC4, IDEA Primary Use (^) Bulk data encryption - files, databases, disk encryption, secure tunnels after handshake Real-Life Example Alice and Bob want to communicate securely using symmetric encryption. They meet in person and agree on a secret key: 'XKCD987!'. Alice uses this key with AES to encrypt her messages before sending them. Bob uses the same key to decrypt them. The problem: their colleague Carol (also needing secure communication with both) needs a different key with each of them. For 100 employees in a company, 4,950 separate keys are needed - impractical! 2.5 Asymmetric Key Cryptography Definition: Asymmetric Key Cryptography Asymmetric key cryptography (also called public key cryptography) is a cryptographic system that uses two mathematically related but distinct keys: a public key (which can be freely shared with anyone) and a private key (which must be kept secret by its owner). Data encrypted with the public key can only be decrypted with the corresponding private key, and vice versa. The two keys are generated together as a keypair using a mathematical one-way function.
Asymmetric cryptography was a revolutionary concept introduced by Whitfield Diffie and Martin Hellman in their 1976 paper 'New Directions in Cryptography'. It solved the key distribution problem of symmetric cryptography by eliminating the need to share a secret key over a secure channel. Anyone can encrypt a message using your public key, but only you can decrypt it using your private key. Two Modes of Operation: