Security goals, attacks and classical ciphers notes — Unit 1
Free unit-wise study notes on security goals, attacks and classical ciphers for Cryptography and Network Security, Semester 7 of B.Tech — Computer Science & Engineering — key concepts, examples, important questions and a revision checklist for semester exams.
Security goals, attacks and classical ciphers
Notebook — 14 pages
Page 1
Wink Notes
B.Tech CSE — 7th Semester
Cryptography and Network Security
— Unit - 1 —
1. Introduction to Computer Security
Computer security rests on confidentiality, integrity, and availability. The fundamental objective is to protect data and systems from unauthorized access, alteration, or destruction.
⇒1.1 The CIA Triad
Confidentiality: Ensures that private or confidential information is not made available or disclosed to unauthorized individuals. Examples include encryption and access control.
Integrity: Comprises data integrity (assuring that information and programs are changed only in a specified and authorized manner) and system integrity (assuring that a system performs its intended function in an unimpaired manner).
Availability: Ensures that systems work promptly and service is not denied to authorized users.
Page 2
Wink Notes
B.Tech CSE — 7th Semester
Cryptography and Network Security
— Unit - 1 —
2. Additional Security Concepts
While the CIA triad is foundational, modern security requires additional guarantees.
Authenticity: The property of being genuine and being able to be verified and trusted; confidence in the validity of a transmission, a message, or message originator.
Accountability: The security goal that generates the requirement for actions of an entity to be traced uniquely to that entity. This supports non-repudiation, deterrence, fault isolation, and after-action recovery.
Non-Repudiation: Prevents either sender or receiver from denying a transmitted message. Thus, when a message is sent, the receiver can prove that the alleged sender in fact sent the message.
Page 3
Wink Notes
B.Tech CSE — 7th Semester
Cryptography and Network Security
— Unit - 1 —
3. OSI Security Architecture
ITU-T Recommendation X.800, Security Architecture for OSI, provides a systematic framework for defining security requirements and characterizing the approaches to satisfying them.
⇒3.1 Core Components
Security Attack: Any action that compromises the security of information owned by an organization.
Security Mechanism: A process (or a device incorporating such a process) that is designed to detect, prevent, or recover from a security attack.
Security Service: A processing or communication service that enhances the security of the data processing systems and the information transfers of an organization. Intended to counter security attacks.
Page 4
Wink Notes
B.Tech CSE — 7th Semester
Cryptography and Network Security
— Unit - 1 —
4. Security Attacks: Passive Attacks
Attacks are classified into two broad categories: Passive and Active. Passive attacks are in the nature of eavesdropping on, or monitoring of, transmissions.
⇒4.1 Types of Passive Attacks
Release of Message Contents: A telephone conversation, an email message, or a transferred file may contain sensitive data. An attacker reading this data is committing this attack.
Traffic Analysis: Even if messages are encrypted, an attacker might observe the pattern of these messages. The opponent could determine the location and identity of communicating hosts and observe the frequency and length of messages being exchanged to guess the nature of communication.
Passive attacks are difficult to detect because they do not involve any alteration of the data. Thus, the emphasis in dealing with passive attacks is on prevention (encryption) rather than detection.
Page 5
Wink Notes
B.Tech CSE — 7th Semester
Cryptography and Network Security
— Unit - 1 —
5. Security Attacks: Active Attacks
Active attacks involve some modification of the data stream or the creation of a false stream.
⇒5.1 Types of Active Attacks
Masquerade: Takes place when one entity pretends to be a different entity (e.g., stealing passwords to log in as someone else).
Replay: Involves the passive capture of a data unit and its subsequent retransmission to produce an unauthorized effect (e.g., resending a valid bank transfer request).
Modification of Messages: Some portion of a legitimate message is altered, or messages are delayed or reordered, to produce an unauthorized effect.
Denial of Service (DoS): Prevents or inhibits the normal use or management of communications facilities (e.g., flooding a server with requests).
Page 6
Wink Notes
B.Tech CSE — 7th Semester
Cryptography and Network Security
— Unit - 1 —
6. Classical Encryption Techniques
The essential ingredients of a symmetric (single-key) encryption scheme are:
Plaintext: The original intelligible message or data.
Encryption Algorithm: Performs various substitutions and transformations on the plaintext.
Secret Key: Input to the encryption algorithm. The exact substitutions depend on this key.
Ciphertext: The scrambled message produced as output.
Decryption Algorithm: Essentially the encryption algorithm run in reverse.
⇒6.1 Basic Operations
All encryption algorithms are based on two general principles: substitution (each element in plaintext is mapped to another element) and transposition (elements in the plaintext are rearranged).
Page 7
Wink Notes
B.Tech CSE — 7th Semester
Cryptography and Network Security
— Unit - 1 —
7. Substitution: Caesar Cipher
The earliest known, and simplest, use of a substitution cipher was by Julius Caesar. It involves replacing each letter of the alphabet with the letter standing three places further down the alphabet.
⇒7.1 The Algorithm
Plain: `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` Cipher: `D E F G H I J K L M N O P Q R S T U V W X Y Z A B C`
Mathematically, if we assign a=0, b=1, ..., z=25: Encryption: `C = (P + k) mod 26` Decryption: `P = (C - k) mod 26` where `k` is the shift amount (key).
⇒7.2 Weakness
The Caesar cipher is extremely vulnerable to brute-force attacks because there are only 25 possible keys.
Page 8
Wink Notes
B.Tech CSE — 7th Semester
Cryptography and Network Security
— Unit - 1 —
8. Monoalphabetic Ciphers
Instead of simply shifting the alphabet, what if we map every letter to any other random letter? This is a general monoalphabetic substitution.
⇒8.1 Key Space
The 'key' is a 26-letter string that defines the substitution. The number of possible keys is `26!` (approx `4 x 10^26`). This completely defeats brute-force attacks.
⇒8.2 Vulnerability: Frequency Analysis
Despite a massive key space, monoalphabetic ciphers are easily broken. In the English language, the letter 'e' appears roughly 12.7% of the time, 't' appears 9%, while 'z' is rare. If the most common letter in the ciphertext is 'Q', then 'Q' almost certainly stands for 'e'.
Page 9
Wink Notes
B.Tech CSE — 7th Semester
Cryptography and Network Security
— Unit - 1 —
9. Polygraphic Substitution: Playfair Cipher
Invented by Charles Wheatstone in 1854, the Playfair cipher encrypts pairs of letters (digraphs) instead of single letters. This significantly flattens the frequency distribution, making analysis much harder.
⇒9.1 The Matrix
It uses a 5x5 matrix of letters constructed using a keyword. (I and J count as one letter to fit 25 slots).
Keyword: MONARCHY `M O N A R` `C H Y B D` `E F G I/J K` `L P Q S T` `U V W X Z`
Rules: 1. If letters are in the same row, replace with letters to their right. 2. If in the same column, replace with letters below them. 3. Otherwise, form a rectangle and pick letters on the opposite corners.
Page 10
Wink Notes
B.Tech CSE — 7th Semester
Cryptography and Network Security
— Unit - 1 —
10. Polyalphabetic Substitution: Vigenère Cipher
To defeat frequency analysis, a polyalphabetic cipher uses multiple monoalphabetic substitutions. The same plaintext letter 'e' might be encrypted as 'Q' the first time, and 'X' the second time.
⇒10.1 The Mechanism
It uses a keyword that is repeated to match the length of the plaintext. The ciphertext letter is found by looking at the intersection of the plaintext row and the keyword column in the Vigenère square (a 26x26 grid of shifted alphabets).
Mathematically: `C_i = (P_i + K_i) mod 26`
Because 'e' is added to different letters of the keyword, it produces different ciphertext letters, flattening the frequency distribution and hiding single-letter statistics.
Page 11
Wink Notes
B.Tech CSE — 7th Semester
Cryptography and Network Security
— Unit - 1 —
11. Vernam Cipher and One-Time Pad
The ultimate defense against frequency analysis is a keyword that is as long as the plaintext and has no statistical relationship to it.
⇒11.1 One-Time Pad (OTP)
An encryption scheme where a random key of the same length as the message is used only once and then discarded. The ciphertext is usually generated using a bitwise XOR.
`C = P ⊕ K`
The One-Time Pad is the only cryptosystem that is mathematically proven to be unbreakable (unconditionally secure). Even with infinite computing power, you cannot crack it because any ciphertext can decrypt to any plaintext of the same length depending on the guessed key.
Drawback: Key distribution. If you can securely share a 1GB random key to encrypt a 1GB file, why not just securely share the file itself?
Page 12
Wink Notes
B.Tech CSE — 7th Semester
Cryptography and Network Security
— Unit - 1 —
12. Transposition (Permutation) Techniques
Instead of substituting letters, transposition ciphers rearrange the order of the letters. The letters themselves remain identical.
⇒12.1 Rail Fence Cipher
The simplest transposition. Write the message as a sequence of diagonals and then read it off row by row.
Plaintext: `meet me after the toga party` `m e m a t r h t g p r y` ` e t e f e t e o a a t` Ciphertext: `MEMATRHTGPRYETEFETEOAAT`
Page 13
Wink Notes
B.Tech CSE — 7th Semester
Cryptography and Network Security
— Unit - 1 —
13. Row Transposition Ciphers
A more complex scheme involves writing the message in a rectangle, row by row, and reading the message off column by column, but permuting the order of the columns.
The key defines the column order.
Key: `4 3 1 2 5 6 7` Text: `a t t a c k p` `o s t p o n e` `d u n t i l t` `w o o x q z e`
Read column 1 (t, t, n, o), then column 2, etc. Ciphertext: `TTNAAPTMTSUOAODWCOIQY...`
To make it harder, you can perform multiple stages of transposition (double transposition).
Page 14
Wink Notes
B.Tech CSE — 7th Semester
Cryptography and Network Security
— Unit - 1 —
14. Steganography
Cryptography hides the contents of a message. Steganography hides the existence of the message entirely.
⇒14.1 Classical Methods
Invisible Ink: Writing with lemon juice that only appears when heated.
Pin punctures: Tiny holes above letters in a newspaper that spell a message.
⇒14.2 Digital Methods
The most common digital method is LSB (Least Significant Bit) Insertion. If you have an image where each pixel's color is defined by 24 bits (8 bits for Red, Green, Blue), modifying the very last bit of every byte will change the color by 1/256th, which is invisible to the human eye. However, those last bits can store a massive hidden text file inside the image.