Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
38 views9 pages

Assignment 01 Ins

The document discusses active cyber attacks, providing examples like denial of service attacks, man-in-the-middle attacks, and malware injection. It also covers encryption techniques for block ciphers like Playfair cipher, Vigenere cipher, and modes of operation such as electronic codebook, cipher block chaining, and counter mode.

Uploaded by

Gaurav bansode
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views9 pages

Assignment 01 Ins

The document discusses active cyber attacks, providing examples like denial of service attacks, man-in-the-middle attacks, and malware injection. It also covers encryption techniques for block ciphers like Playfair cipher, Vigenere cipher, and modes of operation such as electronic codebook, cipher block chaining, and counter mode.

Uploaded by

Gaurav bansode
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Q1 ans In the context of cybersecurity, an active attack refers to a malicious attempt to alter, disrupt,

or destroy data, systems, or networks. Unlike passive attacks, which are focused on eavesdropping or
monitoring information without modifying it, active attacks involve direct interference with the
target. Active attacks are typically more dangerous and can cause immediate harm to the victim's
assets, leading to potential data loss, service disruption, or unauthorized access.

Types of Active Attacks:

1. **Denial of Service (DoS) Attack:** In a DoS attack, the attacker overwhelms a target system (e.g.,
website, server, or network) with a high volume of traffic, requests, or resource-intensive processes,
rendering it unable to respond to legitimate users. Distributed Denial of Service (DDoS) attacks
involve multiple compromised devices working together to flood the target, making them even
harder to mitigate.

2. **Distributed Denial of Service (DDoS) Attack:** In a DDoS attack, a network of multiple


compromised computers (often controlled by the attacker through malware) called a botnet is used
to inundate the target system with traffic, making it unavailable to legitimate users.

3. **Man-in-the-Middle (MitM) Attack:** In a MitM attack, the attacker intercepts and possibly
alters communication between two parties who believe they are directly communicating with each
other. This allows the attacker to eavesdrop on sensitive data, inject malicious content, or manipulate
the communication.

4. **Spoofing:** Spoofing involves forging the source address of data packets or emails to make it
appear as if they are coming from a trusted source. This can be used to gain unauthorized access,
bypass security measures, or launch other attacks like DoS.

5. **Replay Attack:** In a replay attack, the attacker intercepts and records valid data packets and
then retransmits them later to mimic the identity of an authorized user or device, gaining
unauthorized access to a system or network.

6. **Session Hijacking:** Also known as session sniffing or session stealing, this attack occurs when
an attacker intercepts and takes control of an ongoing session between a user and a system. By doing
so, they can impersonate the user and perform unauthorized actions.

7. **Malware Injection:** Active attacks can involve injecting malicious code or malware into a
target system. This may include viruses, worms, Trojans, or ransomware, leading to data theft,
system disruption, or financial losses.
8. **Password Attacks:** Password attacks aim to gain unauthorized access to a system or account
by guessing or cracking passwords. Techniques like brute-force attacks (trying all possible
combinations) and dictionary attacks (using a list of common passwords) fall under this category.

9. **Phishing Attacks:** While phishing attacks are usually considered social engineering attacks,
they can have active components. Phishing emails may contain links to malicious websites or file
attachments that, once clicked or opened, can trigger active attacks like malware downloads or data
theft.

These active attacks highlight the importance of robust cybersecurity measures, including network
security, strong authentication, encryption, and user education to protect against potential threats.

Q2 ans Encrypt and Decrypt the Plain Text-“ComputerDepartment” , Key= “Monarchy “ with

PlayFair Technique

To encrypt and decrypt the plaintext "ComputerDepartment" using the Playfair Technique with the
key "Monarchy," follow these steps:

Step 1: Generate the Playfair matrix

Start by creating a 5x5 matrix (Playfair square) using the given key "Monarchy" (ignoring duplicate
letters and combining "I" and "J"). Fill the matrix with the remaining letters of the alphabet in order
(omitting "J").

Playfair Matrix (Key = "Monarchy"):

MONAR

CHYBD

EFGIK

LPQST

UVWXZ

Step 2: Preprocessing the plaintext

Remove any non-alphabetic characters from the plaintext and convert the text to uppercase, then
group the letters into pairs (digraphs). If there's an odd number of letters, add an "X" at the end to
complete the pair.
Plaintext: COMPUTERDEPARTMENT

Processed: CO MP UT ER DE PA RT ME NT

Step 3: Encrypt using the Playfair rules

For each pair of letters, apply the Playfair rules to encrypt the plaintext:

1. If both letters are in the same row, replace each letter with the letter to its right (circular).

2. If both letters are in the same column, replace each letter with the letter below it (circular).

3. If neither of the above rules applies, create a rectangle with the two letters and replace each letter
with the letter in the opposite corner.

For "CO":

"C" is at (1, 2) and "O" is at (1, 1). Replace "C" with the letter to its right, which is "H", and replace
"O" with the letter to its right, which is "Y".

Encrypted: "HY"

For "MP":

"M" is at (3, 5) and "P" is at (2, 1). Replace "M" with the letter below it, which is "U", and replace "P"
with the letter below it, which is "T".

Encrypted: "UT"

Follow the same procedure for the rest of the digraphs:

"ER" -> "PR"

"DE" -> "BJ"

"PA" -> "LT"

"RT" -> "IX"

"ME" -> "TE"

"NT" -> "XT"

Encrypted text: "HYUTPRBJLTIXTEXTXT"

Step 4: Decryption
To decrypt the ciphertext, follow the reverse process:

Encrypted: "HY UT PR BJ LT IX TE TX TXT"

Decrypted: "CO MP UT ER DE PA RT ME NT"

The decrypted plaintext is "COMPUTERDEPARTMENT".

Q3 State and explain the process of Vigenere Chiper with example

The Vigenère Cipher is a polyalphabetic substitution cipher that uses a keyword to encrypt and
decrypt a message. It is an extension of the Caesar Cipher, where each letter in the plaintext is
shifted according to the corresponding letter in the keyword. The Vigenère Cipher provides stronger
encryption than simple substitution ciphers because it introduces multiple Caesar ciphers based on
the keyword.

Process of Vigenère Cipher:

1. **Key Selection:** Choose a keyword (or passphrase) that will be used for both encryption and
decryption. The keyword should be a word or phrase without any spaces or special characters. Let's
use the keyword "KEY" as an example.

2. **Key Expansion:** Expand the keyword to match the length of the plaintext message. To do this,
repeat the keyword until it becomes the same length as the plaintext. If necessary, truncate any extra
characters in the expanded keyword.

Example:

Plaintext: "HELLO"

Keyword: "KEY"

Expanded Keyword: "KEYKE"

3. **Conversion of Letters:** Convert both the plaintext and the expanded keyword into numerical
values. In the Vigenère Cipher, A = 0, B = 1, C = 2, and so on until Z = 25.

Example:

Plaintext: "HELLO" -> [7, 4, 11, 11, 14]

Expanded Keyword: "KEYKE" -> [10, 4, 24, 10, 4]


4. **Encryption:** Add the numerical values of the plaintext and the expanded keyword (mod 26) to
get the ciphertext. The mod 26 operation ensures that the result stays within the range of the
alphabet (A-Z).

Example:

Plaintext: [7, 4, 11, 11, 14]

Expanded Keyword: [10, 4, 24, 10, 4]

Ciphertext: [(7+10)%26, (4+4)%26, (11+24)%26, (11+10)%26, (14+4)%26]

Ciphertext: [17, 8, 9, 21, 18]

5. **Conversion to Letters:** Convert the numerical values of the ciphertext back into letters using
the reverse conversion from step 3 (A = 0, B = 1, ...).

Example:

Ciphertext: [17, 8, 9, 21, 18]

Ciphertext: "RIJVS"

So, when using the Vigenère Cipher with the keyword "KEY" to encrypt the plaintext "HELLO," the
resulting ciphertext is "RIJVS." To decrypt the ciphertext, you would reverse the process by using the
same keyword and subtracting the numerical values of the ciphertext from the numerical values of
the expanded keyword to obtain the original plaintext.

Q4: Explain modes of operation for Block Chiper technique

Modes of operation for block ciphers are techniques used to encrypt plaintext data of arbitrary
length, which is larger than the fixed block size of the block cipher. These modes enable block ciphers
to handle data in a secure and efficient manner. Here are some commonly used modes of operation
for block ciphers:

1. **Electronic Codebook (ECB):**

In ECB mode, each block of plaintext is independently encrypted using the block cipher. The same
plaintext block will always encrypt to the same ciphertext block, making it deterministic. However,
this makes it susceptible to some vulnerabilities, such as pattern recognition and lack of diffusion.
ECB is not recommended for encrypting multiple blocks of data with the same key.

2. **Cipher Block Chaining (CBC):**

In CBC mode, each plaintext block is XORed with the previous ciphertext block before encryption.
The first block uses an initialization vector (IV) as the "previous" block. This chaining process adds
diffusion and makes each block dependent on all preceding blocks, enhancing security. CBC is widely
used and considered secure when implemented correctly.

3. **Cipher Feedback (CFB):**

CFB mode turns a block cipher into a stream cipher by encrypting the IV and XORing the output with
the plaintext to produce the ciphertext. The IV is then updated with the ciphertext and fed back into
the encryption process for the next block. CFB mode is generally used for encrypting data of small,
irregular sizes.

4. **Output Feedback (OFB):**

Similar to CFB, OFB converts a block cipher into a stream cipher. It encrypts the IV to create a
keystream, which is then XORed with the plaintext to produce the ciphertext. The IV is updated with
the keystream and fed back into the encryption process for subsequent blocks. OFB is mainly used
for applications requiring random access to the ciphertext.

5. **Counter (CTR):**

CTR mode turns a block cipher into a stream cipher by using a counter value as input, which is
incremented for each block of plaintext. The counter value is encrypted to generate a keystream,
which is then XORed with the plaintext to produce the ciphertext. CTR mode allows for parallel
encryption and is commonly used in modern cryptographic applications.

6. **Galois/Counter Mode (GCM):**

GCM mode combines the Counter (CTR) mode with Galois field multiplication. It provides
authenticated encryption, ensuring both confidentiality and integrity of the data. GCM is widely used
in applications like TLS (Transport Layer Security) for secure communication.

Each mode of operation has its strengths and weaknesses, and the choice of mode depends on the
specific requirements of the cryptographic application. When using any mode of operation, it is
crucial to follow recommended practices, such as using unique IVs for each encryption, to ensure
security and prevent potential vulnerabilities.
Q5: Perfrom Encryption on 2*2 matrix Plain Text="retreat now" and key = “Hill” with Hill

Chiper Technique.

To perform encryption using the Hill Cipher technique, we need to convert the given plaintext and
key into matrices, perform matrix multiplication, and then convert the resulting matrix back into
ciphertext. Let's follow the steps to encrypt the given 2x2 matrix plaintext "retreat now" with the
key "Hill":

Step 1: Convert the plaintext and key into numerical values:

```

Plaintext: "retreat now"

Key: "Hill"

```

Convert each letter to its corresponding numerical value (A=0, B=1, ..., Z=25). Combine the
plaintext letters into groups of 2 (since it's a 2x2 matrix).

```

Plaintext: "re tr ea tn ow"

Numerical values: [17, 4, 19, 17, 0, 13, 19, 22]

```

Convert the key "Hill" into a 2x2 matrix:

```

H i

l l

Numerical values: [7, 8, 11, 11]

```
Step 2: Create the 2x2 matrix for plaintext:

```

Plaintext Matrix:

| 17 4 |

| 19 17 |

```

Step 3: Create the 2x2 matrix for the key:

```

Key Matrix:

| 7 8|

| 11 11 |

```

Step 4: Perform matrix multiplication (Plaintext Matrix * Key Matrix):

```

Ciphertext Matrix:

| (17*7 + 4*11) (17*8 + 4*11) |

| (19*7 + 17*11) (19*8 + 17*11) |

```

Calculations:

```

Ciphertext Matrix:

| (119 + 44) (136 + 44) |

| (133 + 187) (152 + 187) |

Ciphertext Matrix:
| 163 180 |

| 320 339 |

```

Step 5: Convert the resulting matrix back into ciphertext:

```

Ciphertext Numerical Values: [163, 180, 320, 339]

```

Step 6: Convert numerical values back to letters:

```

Ciphertext: "gwcmzq"

```

So, the encrypted ciphertext for the given 2x2 matrix plaintext "retreat now" with the key "Hill"
using the Hill Cipher technique is "gwcmzq".

You might also like