INS unit 1
INS unit 1
The OSI (Open Systems Interconnection) security architecture provides a framework for implementing
security measures across the seven layers of the OSI model. It defines security services and mechanisms
that can be applied at each layer to protect data and ensure secure communication. The architecture
includes:
1. **Security Services**: These are measures that enhance the security of data processing systems and
information transfers. Key services include:
- **Authentication**: Verifying the identity of users and systems.
- **Access Control**: Restricting access to resources based on policies.
- **Data Confidentiality**: Ensuring that data is not disclosed to unauthorized entities.
- **Data Integrity**: Protecting data from unauthorized modification.
- **Non-Repudiation**: Ensuring that a party cannot deny the authenticity of their signature on a
document or a message that they sent.
2. **Security Mechanisms**: These are methods to implement security services, such as encryption, digital
signatures, and secure communication protocols.
3. **Security Management**: Involves the administration and maintenance of security mechanisms and
services, including key management, monitoring, and responding to security incidents.
### Security Requirements Triad
The Security Requirements Triad, also known as the CIA Triad, consists of three core principles essential for
the protection of information systems:
1. **Confidentiality**: This principle ensures that sensitive information is accessed only by authorized
individuals. Methods to achieve confidentiality include encryption, access control lists, and authentication
protocols.
2. **Integrity**: Integrity involves maintaining the accuracy and consistency of data over its entire lifecycle.
It ensures that data has not been altered in an unauthorized manner. Techniques to protect integrity
include hashing, checksums, and digital signatures.
3. **Availability**: This ensures that information and resources are available to authorized users when
needed. Availability can be protected through redundancy, failover systems, and proper network and
system management.
### CIA Triad
The CIA Triad is a model designed to guide policies for information security within an organization. It
consists of:
1. **Confidentiality**: Measures to prevent unauthorized access to sensitive information. Common
techniques include encryption, user authentication, and access controls.
2. **Integrity**: Ensures that information is trustworthy and accurate. Mechanisms like hashing, digital
signatures, and checksums verify that data has not been altered.
3. **Availability**: Ensures that data and resources are accessible to authorized users. Techniques include
maintaining redundant systems, implementing disaster recovery plans, and defending against denial-of-
service attacks.
### Attacks and Types
An attack is an attempt by an unauthorized individual or entity to access, steal, or damage information or
disrupt services. Attacks can be broadly categorized into:
1. **Passive Attacks**: These involve monitoring communications without altering them. The goal is to
obtain information being transmitted. Examples include:
- **Eavesdropping**: Listening to private communications.
- **Traffic Analysis**: Observing the patterns of communication to deduce information.
2. **Active Attacks**: These involve actions that alter system resources or affect their operations. Types
include:
- **Masquerade**: Pretending to be another entity to gain unauthorized access.
- **Replay**: Re-transmitting a valid data transmission to produce unauthorized effects.
- **Modification of Messages**: Changing parts of a message to gain unauthorized advantages.
- **Denial-of-Service (DoS)**: Preventing legitimate users from accessing a service.
### Passive Attacks
Passive attacks are characterized by the attacker not interacting directly with the target system. Instead,
they observe and gather information. The main goal is to obtain information that is being communicated or
processed. Key types include:
1. **Eavesdropping**: This involves intercepting and monitoring communications, such as phone calls,
emails, or network traffic. The attacker can gather sensitive information like passwords, credit card
numbers, or confidential business data.
2. **Traffic Analysis**: Even if the data being transmitted is encrypted, an attacker can analyze the pattern,
timing, and volume of traffic to infer information about the communication, such as identifying
communication partners, the frequency of communication, or the presence of important events.
### Active Attacks
Active attacks involve an attacker trying to alter the system's resources or its operations. The attacker may
inject malicious data, modify legitimate data, or interrupt services. Types include:
1. **Masquerade**: An attacker impersonates another user or system, gaining unauthorized access to
resources. For example, they may use stolen credentials to log in as another user.
2. **Replay**: The attacker captures a legitimate message and retransmits it, potentially causing
unintended actions. For example, retransmitting a valid financial transaction can result in duplicate
payments.
3. **Modification of Messages**: The attacker alters a legitimate message. For example, changing the
amount in a financial transaction message can cause incorrect payments.
4. **Denial-of-Service (DoS)**: The attacker disrupts the normal functioning of a system, making it
unavailable to users. This can be done by overwhelming the system with traffic or exploiting software
vulnerabilities to crash the system.
### X.800 Security Services
The X.800 standard, also known as the ISO 7498-2, defines a set of security services and mechanisms for
protecting information and ensuring secure communications. The main security services include:
1. **Authentication**: Ensuring that the communicating parties are who they claim to be. This includes
both entity authentication (verifying identities) and data origin authentication (verifying the source of
data).
2. **Access Control**: Restricting access to resources based on pre-defined policies. This ensures that only
authorized users can access certain data or services.
3. **Data Confidentiality**: Protecting data from unauthorized disclosure. Encryption is a common method
to achieve confidentiality.
4. **Data Integrity**: Ensuring that data has not been altered in an unauthorized manner. Techniques
include hashing and digital signatures.
5. **Non-Repudiation**: Providing proof of the origin or delivery of data, ensuring that neither the sender
nor the receiver can deny having processed the data.
### Security Mechanisms
Security mechanisms are tools and techniques used to implement security services. These include:
1. **Encryption**: Converts plain text into ciphertext to protect data confidentiality. It can be symmetric
(same key for encryption and decryption) or asymmetric (different keys for encryption and decryption).
2. **Digital Signatures**: Provide authentication, integrity, and non-repudiation by using a cryptographic
hash function and a private key to sign a document.
3. **Access Control Mechanisms**: These include password systems, biometric systems, and access
control lists (ACLs) that define who can access certain resources.
4. **Authentication Protocols**: Protocols like Kerberos and SSL/TLS that verify the identities of
communicating parties.
5. **Firewalls**: Network security devices that monitor and filter incoming and outgoing network traffic
based on security rules.
6. **Intrusion Detection Systems (IDS)**: Monitor network or system activities for malicious actions or
policy violations.
### X.800 Security Mechanisms
X.800 describes specific mechanisms that provide security services, including:
1. **Encipherment**: The process of converting plain text into an unintelligible format using algorithms
and keys, protecting data confidentiality. It includes both symmetric and asymmetric encryption
techniques.
2. **Digital Signature**: A method for validating the authenticity and integrity of a message, software, or
digital document. It uses a private key to sign the data and a public key for verification.
3. **Access Control**: Mechanisms that manage and control how resources are accessed, ensuring that
only authorized users can access specific resources.
4. **Data Integrity**: Mechanisms that provide assurance that data has not been altered, such as
cryptographic checksums and hash functions.
5. **Authentication Exchange**: The process of exchanging messages to verify the identity of
communicating parties, often using credentials or certificates.
6. **Traffic Padding**: Inserting extra data into messages to make it difficult to analyze communication
patterns, protecting against traffic analysis attacks.
7. **Routing Control**: Ensuring that data travels over secure and trusted paths, avoiding potentially
compromised nodes.
8. **Notarization**: A trusted third party confirms the authenticity and integrity of transactions, providing
a timestamp and a signature.
### Symmetric Cipher Model
The symmetric cipher model uses the same key for both encryption and decryption. It is efficient and fast
but requires secure key management and distribution. The key must be kept secret, as anyone with the key
can decrypt the data. Examples of symmetric ciphers include:
1. **Data Encryption Standard (DES)**: A block cipher that encrypts data in 64-bit blocks using a 56-bit key.
It uses 16 rounds of a complex function involving permutations and substitutions.
2. **Advanced Encryption Standard (AES)**: A more secure block cipher that supports key sizes of 128,
192, or 256 bits. It uses multiple rounds of processing, including substitution, permutation, and mixing.
### Principles of Public-Key Cryptosystems
Public-key cryptosystems use two keys: a public key (known to everyone) and a private key (kept secret by
the owner). The principles include:
1. **Asymmetric Key Pairs**: The public key is used for encryption, while the private key is used for
decryption. The keys are mathematically related, but it is computationally infeasible to derive the private
key from the public key.
2. **Key Distribution**: The public key can be freely distributed, but the private key must be kept secure.
This makes public-key cryptosystems suitable for secure communications over insecure channels.
3. **Digital Signatures**: Public-key cryptosystems also support digital signatures, where the private key is
used
to sign data, and the public key is used to verify the signature. This provides authentication and non-
repudiation.
4. **Encryption and Decryption**: The sender encrypts data using the recipient's public key, ensuring that
only the recipient, who possesses the corresponding private key, can decrypt the data.
### Substitution Techniques
Substitution techniques involve replacing elements of the plaintext with other elements. This can be done
using different methods:
1. **Caesar Cipher**: A simple substitution technique where each letter in the plaintext is shifted a fixed
number of positions down or up the alphabet. For example, with a shift of 3, 'A' becomes 'D'.
2. **Monoalphabetic Cipher**: Each letter in the plaintext is replaced by a corresponding letter from a
fixed, mixed alphabet. Unlike the Caesar cipher, the substitution is not systematic, making it harder to break
but vulnerable to frequency analysis.
3. **Polyalphabetic Ciphers**: Use multiple substitution alphabets to encrypt the plaintext. An example is
the Vigenère cipher, which uses a keyword to determine the shift for each letter.
4. **Playfair Cipher**: A digraph substitution cipher that encrypts pairs of letters using a 5x5 grid
containing a keyword. It replaces each pair of letters with another pair based on their positions in the grid.
### Playfair Cipher
The Playfair cipher is a digraph substitution cipher that encrypts pairs of letters. It uses a 5x5 grid filled with
a keyword, followed by the remaining letters of the alphabet (I and J are usually combined). To encrypt,
pairs of letters are taken and replaced based on their positions in the grid:
1. If both letters are in the same row, each letter is replaced by the letter to its right (circularly).
2. If both letters are in the same column, each letter is replaced by the letter below it (circularly).
3. If the letters form a rectangle, they are replaced by the letters on the same row but at the opposite
corners of the rectangle.
For example, with the keyword "MONARCHY" and the plaintext "HELLO":
1. H and E are in different rows and columns, forming a rectangle with M and A. Thus, H becomes M, and E
becomes A.
2. L and L form a pair; since they are identical, a filler letter (e.g., X) is added. "LX" becomes "LR" based on
the grid.
### Mono-Alphabetic Cipher with an Example
A monoalphabetic cipher uses a single substitution alphabet to replace each letter in the plaintext with
another letter. For example, if the substitution alphabet is randomly mixed as follows:
Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Cipher: QWERTYUIOPASDFGHJKLZXCVBNM
The plaintext "HELLO" would be encrypted as "ITSSG". Monoalphabetic ciphers are simple but vulnerable to
frequency analysis, as the frequency of letters in the ciphertext can reveal patterns corresponding to the
plaintext.
### Transposition Techniques
Transposition techniques rearrange the positions of characters in the plaintext, rather than substituting
them with other characters. Common methods include:
1. **Rail Fence Cipher**: The plaintext is written in a zigzag pattern across multiple "rails" and then read
row by row to create the ciphertext. For example, the plaintext "HELLO WORLD" with three rails would be
written as:
H...O...R...
.E.L.W.L.D..
..L...O....
The ciphertext is "HORLELWDLO".
2. **Columnar Transposition**: The plaintext is written in rows within a grid, then read column by column
according to a defined order. For example, with the keyword "ZEBRAS" and plaintext "WE ARE
DISCOVERED", the grid might look like:
ZEBRAS
WEARED
ISCOVE
REDXXX
Reading columns based on the alphabetical order of the keyword, the ciphertext becomes
"EVRESEWACRREDDIOX".
### Steganography
Steganography is the practice of hiding information within other, seemingly innocuous data. Unlike
cryptography, which makes data unreadable to unauthorized users, steganography conceals the existence
of the data itself. Techniques include:
1. **Text Steganography**: Hiding messages within text, such as using every nth letter of words in a
passage.
2. **Image Steganography**: Hiding data within images, often by modifying the least significant bits of
pixel values. For example, a digital image can have its pixel values slightly altered to encode a secret
message without visibly changing the image.
3. **Audio and Video Steganography**: Embedding data in audio or video files. This can be done by
manipulating the digital representation of the media, such as modifying audio frequencies or video frames.
Steganography provides a layer of security through obscurity, making it difficult for adversaries to detect
the hidden data.
### Feistel Structure of Encryption & Decryption
The Feistel structure is a symmetric block cipher design used to construct various encryption algorithms,
including DES. It splits the plaintext into two halves and processes them through multiple rounds, involving
substitution and permutation functions.
1. **Encryption Process**:
- The plaintext is divided into left (L) and right (R) halves.
- In each round, a round function (F) is applied to the right half and a subkey. The output is XORed with
the left half, and then the halves are swapped.
- The process is repeated for a specified number of rounds, using a different subkey for each round.
- After the final round, the halves are not swapped, and the combined blocks form the ciphertext.
2. **Decryption Process**:
- The process is identical to encryption, except that the subkeys are used in reverse order. The structure's
symmetry ensures that the decryption function is the inverse of the encryption function.
The Feistel structure allows for easy implementation of the inverse function, making it efficient for both
encryption and decryption.
### Data Encryption Standard (DES)
DES is a symmetric-key block cipher that encrypts data in 64-bit blocks using a 56-bit key. It operates
through 16 rounds of a Feistel structure, each involving a combination of permutation and substitution
operations. The process includes:
1. **Initial Permutation (IP)**: The plaintext is initially permuted according to a fixed table.
2. **Round Function**:
- The block is divided into left and right halves.
- The right half is expanded from 32 bits to 48 bits using an expansion permutation.
- The expanded right half is XORed with a 48-bit round subkey.
- The result is passed through a series of S-boxes, which provide non-linear substitution.
- The output is permuted and XORed with the left half, which then becomes the new right half, and the
old right half becomes the new left half.
3. **Final Permutation (FP)**: After the 16 rounds, the halves are combined and permuted again using the
inverse of the initial permutation.
DES has been widely used but is now considered insecure due to its relatively short key length, making it
vulnerable to brute-force attacks.
### Triple DES (3DES)
Triple DES (3DES) enhances the security of DES by applying the encryption process three times with
different keys. It uses three 56-bit keys (K1, K2, K3), effectively creating a 168-bit key. The process involves:
1. **Encrypt with K1**: The plaintext is encrypted using the first DES key (K1).
2. **Decrypt with K2**: The result is decrypted using the second key (K2).
3. **Encrypt with K3**: The output is encrypted again with the third key (K3).
3DES provides a significant security improvement over DES by increasing the key length, making brute-force
attacks more difficult. However, it is slower and has been largely replaced by AES.
### AES Encryption & Decryption
The Advanced Encryption Standard (AES) is a symmetric block cipher that encrypts data in 128-bit blocks
using key sizes of 128, 192, or 256 bits. AES is widely used due to its security and efficiency. The algorithm
consists of:
1. **Key Expansion**: The original key is expanded into an array of round keys using a key schedule.
2. **Initial Round**:
- **AddRoundKey**: The plaintext block is XORed with the first round key.
3. **Rounds** (repeated depending on the key size: 10 rounds for 128-bit keys, 12 for 192-bit, and 14 for
256-bit):
- **SubBytes**: A non-linear substitution step where each byte is replaced with another according to an
S-box.
- **ShiftRows**: A transposition step where each row of the state is shifted cyclically by a certain number
of steps.
- **MixColumns**: A mixing operation that combines the four bytes of each column.
- **AddRoundKey**: The state is XORed with the round key derived from the main key.
4. **Final Round**: This round does not include the MixColumns step.
AES is known for its strong security due to the complexity of its rounds and the large key sizes, making it
resistant to most known attacks.
### Electronic Code Book (ECB)
ECB is a mode of operation for block ciphers. In ECB, each block of plaintext is encrypted independently
using the same key, producing ciphertext blocks. While simple and parallelizable, ECB has significant
weaknesses:
1. **Identical Blocks**: Identical
plaintext blocks produce identical ciphertext blocks, revealing patterns and potentially leaking information
about the plaintext.
2. **Lack of Diffusion**: Changes in one block do not affect others, making it less secure against certain
types of attacks.
ECB is generally not recommended for encrypting large amounts of data or sensitive information due to
these vulnerabilities.
### Cipher Block Chaining (CBC) & Cipher Feedback Mode (CFB)
**CBC**:
- In CBC mode, each plaintext block is XORed with the previous ciphertext block before being encrypted.
The first block is XORed with an initialization vector (IV).
- Decryption involves reversing the process, using the IV and the previous ciphertext block.
- CBC provides better security than ECB by ensuring that identical plaintext blocks encrypt to different
ciphertext blocks.
**CFB**:
- CFB turns a block cipher into a self-synchronizing stream cipher. An IV is encrypted, and the result is
XORed with the plaintext block to produce the ciphertext.
- The ciphertext block is then used as input for the next encryption, ensuring that identical plaintext blocks
produce different ciphertext.
- CFB is useful for encrypting data of arbitrary length and provides good error propagation.
### Modes of Operation in DES
DES supports several modes of operation to enhance security and usability:
1. **ECB (Electronic Code Book)**: Encrypts each block independently, but suffers from pattern leakage.
2. **CBC (Cipher Block Chaining)**: Each block is XORed with the previous ciphertext block, improving
security.
3. **CFB (Cipher Feedback)**: Converts a block cipher into a stream cipher, suitable for encrypting data of
varying lengths.
4. **OFB (Output Feedback)**: Similar to CFB but does not propagate encryption errors.
5. **CTR (Counter)**: Uses a counter to encrypt blocks, allowing for parallel encryption and decryption.
Each mode offers different security properties and is suitable for different applications.
### RSA Algorithm
RSA is a widely used public-key cryptosystem that relies on the mathematical properties of prime numbers
and modular arithmetic. The RSA algorithm involves:
1. **Key Generation**:
- Select two large prime numbers, p and q.
- Compute n = p * q and φ(n) = (p - 1)(q - 1).
- Choose an integer e such that 1 < e < φ(n) and gcd(e, φ(n)) = 1.
- Compute d as the modular multiplicative inverse of e modulo φ(n), satisfying d * e ≡ 1 (mod φ(n)).
- The public key is (e, n), and the private key is (d, n).
2. **Encryption**:
- Convert the plaintext message M into an integer m such that 0 < m < n.
- Compute the ciphertext c = m^e mod n.
3. **Decryption**:
- Compute m = c^d mod n, and convert m back to the plaintext message.
RSA provides security based on the difficulty of factoring large numbers and is used for secure data
transmission, digital signatures, and key exchange.
Each version provides varying levels of security and performance, with longer keys offering greater security
against brute-force attacks.