Unit 1 Data Encryption & Compression (1)
Unit 1 Data Encryption & Compression (1)
2. Security Approaches:
1. Preventive Approach:
o Authentication Mechanisms: Passwords, biometrics.
o Access Control: Permissions to limit user operations.
o Encryption: Protects data in transit and storage.
2. Detective Approach:
o Intrusion Detection Systems (IDS): Monitors for unusual
activities.
o Audit Logs: Records access and activities for review.
3. Corrective Approach:
o Patch Management: Fixes vulnerabilities.
o Backup and Recovery: Restores data after an attack.
3.Principles of Security:
Additional principles:
. 4. Types of Attacks:
Passive Attacks:
o Eavesdropping on communication.
o Traffic analysis to infer patterns.
Active Attacks:
o Replay Attacks: Intercepting and retransmitting data.
o Masquerading: Pretending to be another entity.
o Modification of Messages: Altering legitimate data.
o Denial of Service (DoS): Disrupting service availability.
Insider Threats:
o Malicious actions by authorized personnel.
Malware-Based Attacks:
o Viruses, worms, ransomware, etc.
1. Passive Attacks
These attacks do not alter the system but aim to gather information stealthily.
Eavesdropping:
Monitoring unencrypted data in transit, such as emails or file transfers.
Example: Sniffing tools like Wireshark capturing sensitive data on a
network.
Traffic Analysis:
Observing patterns in communication to infer details about activities or
systems, even if the data is encrypted.
Impact: Breaches confidentiality without altering systems.
2. Active Attacks
Active attacks involve tampering with the system or data to disrupt or misuse
operations.
Masquerade:
An attacker pretends to be a legitimate user or entity.
Example: Fake login portals phishing for credentials.
Replay Attack:
Capturing and retransmitting valid data to deceive the system.
Example: Reusing session cookies to access accounts.
Message Modification:
Altering data during transmission to manipulate its meaning or outcome.
Example: Changing bank account details in a transaction request.
Denial of Service (DoS):
Overloading a system with excessive requests, causing it to crash or
become unavailable.
Example: Flooding a server with traffic using botnets.
Distributed Denial of Service (DDoS):
Similar to DoS but uses multiple sources to launch a coordinated attack.
3. Insider Attacks
Malicious Intent:
Disgruntled employees stealing data or sabotaging systems.
Negligence:
Accidental exposure of sensitive data due to poor handling.
Impact: Often more damaging due to insiders' access to sensitive areas.
4. Malware-Based Attacks
Virus:
Infects files and spreads when executed.
Example: A macro virus spreading through infected Word documents.
Worms:
Self-replicating malware that spreads without user interaction.
Example: The "ILOVEYOU" worm.
Trojan Horse:
Disguised as legitimate software but performs malicious actions once
installed.
Ransomware:
Encrypts files and demands payment to restore access.
Example: WannaCry ransomware.
Spyware:
Secretly gathers user information, such as passwords or browsing habits.
Adware:
Displays unwanted advertisements and may redirect browsing.
Encryption Techniques:
1. Plain Text
Example: Messages like "Hello, how are you?" or sensitive data like
passwords.
2. Cipher Text
Cipher text is the result of encryption—an unreadable format of the plain text,
which requires a decryption key to convert it back.
3. Substitution Techniques
These methods replace plain text elements (characters, bits, etc.) with
substitutes based on a defined system.
1. Caesar Cipher:
The Caesar Cipher is one of the simplest and oldest encryption techniques. It is
a substitution cipher where each letter in the plaintext is replaced by a letter a
fixed number of positions down the alphabet.
Encryption Process:
1. Choose a shift value (key), which determines how many positions each
letter is shifted.
2. Replace each letter in the plaintext with the letter that is the chosen
number of positions ahead in the alphabet.
3. If the end of the alphabet is reached, wrap around to the beginning (cyclic
nature).
Decryption Process:
Reverse the encryption process by shifting letters back by the same key.
Example:
Plaintext: HELLO
Key: 3
Alphabet Mapping:
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
Encryption:
o H→K
o E→H
o L→O
o L→O
o O→R
o Ciphertext: KHOOR
Decryption:
o Reverse the process: Shift KHOOR by -3.
o K → H, H → E, O → L, O → L, R → O.
o Plaintext: HELLO
Strengths:
Easy to implement.
Suitable for educational purposes or very low-security applications.
Weaknesses:
Applications:
2. Monoalphabetic Substitution:
Each character is replaced by another, but the substitution is not uniform like
Caesar Cipher.
Example: A random mapping where A → Z, B → Y, etc.
The Monoalphabetic Substitution Cipher is a type of substitution cipher
where each letter in the plaintext is replaced by a fixed corresponding letter
from a substitution alphabet. Unlike the Caesar Cipher, the substitution
mapping is not limited to a uniform shift; it can be arbitrary.
Key Characteristics:
Encryption Process:
2. Replace each plaintext letter with its corresponding cipher text letter.
Decryption Process:
Reverse the process using the same substitution alphabet to retrieve the
original plaintext.
Example:
Plaintext: HELLO
Encryption:
o H→I
o E→T
o L→G
o L→G
o O→P
o Ciphertext: ITGGP
Decryption:
o Reverse the mapping:
I → H, T → E, G → L, G → L, P → O.
o Plaintext: HELLO
Strengths:
Offers more security than the Caesar Cipher due to a large number of
possible keys.
Randomized mapping increases resistance to brute-force attacks.
Weaknesses:
1. Frequency Analysis:
o The most common letters in the cipher text can be matched to
common letters in the language (e.g., 'E' in English).
o Example: If 'Q' appears frequently, it might correspond to 'E'.
2. Key Management:
o The key (substitution alphabet) must be securely shared between
sender and receiver.
Applications:
3. Polyalphabetic Cipher:
Key Characteristics:
Encryption Process:
Example:
Plaintext: HELLO
Key: KEY
o Repeat the key to match the length of the plaintext: KEYKE.
Encryption Steps:
Example:
Ciphertext: RIJVS
Decryption Process:
Strengths:
Weaknesses:
1. Key Repetition: Repeating the key creates patterns, which attackers can
exploit (e.g., Kasiski examination).
2. Key Distribution: Both sender and receiver need access to the same key
securely.
Applications:
Historically used for military communication (e.g., by diplomats and
during wars).
Basis for understanding modern encryption techniques.
Key Features:
Advantages:
Disadvantages:
4. Transposition Techniques
Simple Transposition:
Rearranges the letters of a message according to a fixed pattern.
Example: "HELLO" → "OLLEH".
Columnar Transposition:
Writes the plain text in rows of a grid and rearranges the columns based
on a specific order.
Example:
Plain text: "WEAREDISCOVERED"
Rearranged: "WECRLTEERDSOEEAIVD".
The Columnar Transposition Cipher is a transposition cipher where the plaintext is written
in rows of a grid (or matrix), and then columns are reordered based on a key to form the
ciphertext. It rearranges the letters rather than replacing them, making it more secure against
simple attacks like frequency analysis.
Steps to Encrypt:
1. Choose a Key:
o The key determines the number of columns and the order in which
the columns are rearranged.
o Example key: ZEBRA
o Assign numerical values based on the alphabetical order of the
letters in the key:
o ZEBRA
o 52143
4. Read Column-wise:
o Read the grid column by column in the order defined by the key.
o Ciphertext: ARESIVOWDERCED.
Steps to Decrypt:
2. Read Row-wise:
o Read the plaintext row by row.
Example Encryption:
Given:
Advantages:
Simple to implement.
Effective against frequency analysis.
Disadvantages:
Encryption: The process of converting plain text into cipher text using
an algorithm and a key.
Decryption: Reverses the encryption process, converting cipher text back
to plain text using the key.
o Example:
Plain text: "HELLO".
Encryption with Caesar Cipher (key=3): "KHOOR".
Decryption with the same key restores "HELLO".
2. No Assumptions:
o Unlike other attacks (e.g., dictionary attacks), brute force does not
rely on patterns or heuristics; it simply tries every option.
1. Password Cracking:
o Breaking weak passwords in systems.
2. Key Recovery:
o Breaking encryption by finding the secret key.
3. Testing Systems:
o Used by security professionals to test system resilience against
brute force.
2. Cryptanalysis Attack:
3. Man-in-the-Middle Attack:
4. Side-Channel Attack:
The key is the fundamental element that determines the strength of encryption.