حل اسئلة امنية المعلومات قسم الحاسوب الجامعة المستنصرية نموذج رقم 1

codinglabsolution


    1حل اسئلة امنية المعلومات قسم الحاسوب الجامعة المستنصرية نموذج رقم 

حل اسئلة امنية المعلومات قسم الحاسوب الجامعة المستنصرية نموذج رقم 1



Q1) Answer the following MCQ: ((8-points)) 

1. Which of the following treat that an authorized party has gained access to an asset?

 A. Interruption B. Interception C. Modification D. None of them 

2. Vulnerability Lack of __________ policy:

 A. Bug B. Threat C. Attack D. Access Control 

3. Computer Security has many controls one of them is firewall that refelct on:

 A. Encryption B. Physical C. H/W D. S/W 

4. What will be the Cipher text corresponding to cipher text “corresponding” if rail fence cipher is used with key value 2?

 A. CREPNINORSODGX 

B. CREPNIGORSODNX 

C. CREPWYGORSOXNX

 D. CREPNDNORSODIX 

5. In security field, the sender and receiver, each were using different keys, usually two sets of keys, one for encryption and the other for decryption is called 

A. Symmetric Key B. Key generation C. One-time pad Key D. Asymmetric key

 6. Exclusive-OR operation between the number 51 and the number 112 is (51 XOR 112):

 A. 224 B. 225 C. 127 D. 227 

7. Specify which one of these numbers is not a prime number? 

A.101 B. 105 C. 103 D. 107 

8. In RSA the encryption number (x) should be an integer (x) such 

A. 2 < x < φ(n) and gcd(x, φ (n)) = 3 

B. 4< x < φ(n) and gcd(x, φ (n)) = 5 

C. 1 < x < φ(n) and gcd(x, φ (n)) = 1 

D.6 < x < φ(n) and gcd(x, φ (n)) =7


Q2) Answer TWO of the following: (8-points)

 A. Define confidentiality and authentication?

Sol//

confidentiality :-It is the protection of transmitted data from passive attacks.With respect to the release of message contents, several levels of protection can be identified.The broadest service protects all user data other aspect .transmitted between two users over a period of time confidentiality protection of traffic flow from analysis .

السرية :- هي حماية البيانات المرسلة من الهجمات السلبية. فيما يتعلق بالإفراج عن محتويات الرسالة يمكن تحديد عدة مستويات من الحماية. الخدمة الأوسع تحمي جميع بيانات المستخدم الأخرى .المرسلة بين مستخدمين على مدى فترة من الزمن. حماية سرية تدفق حركة المرور من التحليل.

authentication:-The authentication service is concerned with securing that acommunication is authentic. In case of an ongoing interaction, such as the connection of a terminal to a host.

المصادقة:- تهتم خدمة المصادقة بالتأكد من صحة الاتصال. في حالة التفاعل المستمر، مثل اتصال الجهاز الطرفي بالمضيف.


 B. If Cipher text is” OVIDCEBTDKRLRO1UTC9T1U”, use PlayFair to decrypt this text using Keyword”COVID19”? Write all required steps of solution. 

Sol//

To decrypt the given ciphertext using the Playfair cipher with the keyword "COVID19," we'll follow these steps:

1. Create the Playfair Matrix:

   - Start with the keyword "COVID19" and append the remaining letters of the alphabet (excluding duplicates and "J").

   - Construct a 5x5 matrix using these letters, usually filling rows first.

2. Decrypt the Ciphertext:

   - Divide the ciphertext into pairs of letters (digraphs).

   - Apply the rules of the Playfair cipher to decrypt each digraph.

     - If the letters are in the same row, replace each letter with the letter to its left (wrapping around if needed).

     - If the letters are in the same column, replace each letter with the letter above it (wrapping around if needed).

     - If the letters form a rectangle, replace each letter with the letter in the same row but opposite corner of the rectangle.

3. Handle Special Cases:

   - If a digraph contains a repeated letter, insert an additional letter (like "X") between them before decrypting.

   - If the original plaintext had an odd number of letters, add a filler letter (like "X") to the end before decrypting.


Let's apply these steps:

1. Create the Playfair Matrix:

   ```

   C O V I D

   1 9 A B E

   F G H K L

   M N P Q R

   S T U W X

   ```

2. Decrypt the Ciphertext:

   - O -> J (Same column)

   - VI -> QD (Rectangle)

   - CE -> FH (Same row)

   - BT -> IP (Rectangle)

   - DK -> NP (Rectangle)

   - RL -> PQ (Rectangle)

   - RO -> QD (Rectangle)

   - 1U -> 9B (Rectangle)

   - TC -> HU (Rectangle)

   - 9T -> BA (Rectangle)

   - 1U -> 9B (Rectangle)


3. Result:

   - Decrypted Text: "JOIN QDFH IP NP PQ QD 9B HU BA 9B"


C. What will be the ciphered text if the plain text “BMMUST” is encrypted using hill cipher with keyword as “GYBNQKURP”? Using the following alphabet: 

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 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

Sol/

To encrypt the plaintext "BMMUST" using the Hill cipher with the keyword "GYBNQKURP" and the given alphabet, we need to follow these steps:

1. Convert the plaintext and keyword into numerical values according to the given alphabet.

2. Arrange the keyword letters into a 3x3 matrix to form the encryption key matrix.

3. Divide the plaintext letters into groups of three and convert them into numerical values.

4. Multiply each group of plaintext numerical values by the encryption key matrix modulo 26.

5. Convert the resulting numerical values back into letters using the given alphabet.

1. قم بتحويل النص العادي والكلمة الرئيسية إلى قيم رقمية وفقًا للأبجدية المحددة.

2. قم بترتيب حروف الكلمات الرئيسية في مصفوفة 3x3 لتكوين مصفوفة مفاتيح التشفير.

3. قم بتقسيم الحروف النصية العادية إلى مجموعات مكونة من ثلاثة وتحويلها إلى قيم رقمية.

4. اضرب كل مجموعة من القيم الرقمية للنص العادي في وحدة مصفوفة مفتاح التشفير 26.

5. قم بتحويل القيم الرقمية الناتجة مرة أخرى إلى أحرف باستخدام الأبجدية المحددة.


Let's go through these steps:


1. Plaintext "BMMUST" converts to numerical values: {2, 13, 13, 21, 19, 20}.

2. Keyword "GYBNQKURP" converts to numerical values: {7, 25, 2, 14, 17, 10, 20, 18, 16}.

3. Arrange the keyword numerical values into a 3x3 matrix:

```

7  25  2

14 17  10

20  18 16

```

4. Group the plaintext numerical values into groups of three: {2, 13, 13}, {21, 19, 20}.

5. Perform matrix multiplication:

```

[7  25  2 ]   [2  21 ]   [145  905 ]

[14 17  10] * [13 19] = [588  1346]

[20  18 16]   [13 20]   [859  1499]

```

6. Convert the resulting numerical values back into letters:

```

145  905  -> BMM

588  1346 -> UST

859  1499 -> NUL

```

So, the ciphertext for the plaintext "BMMUST" using the Hill cipher with the given keyword is "BMMUSTNUL".


Q3) Answer TWO of the following: (8-points) 

A. Decrypt the cipher text ‘SENUSKCUXQ’ using Caesar method and KEY=6. 

Sol//

To decrypt the cipher text 'SENUSKCUXQ' using the Caesar cipher method with a key of 6, we simply shift each letter backward in the alphabet by 6 positions:

Original alphabet:   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

Encrypted alphabet:  S E N U S K C U X Q

Decrypted text:       M Y H O M E W O R K

So, the decrypted text is 'MYHOMEWORK'.

B. Explain Active and Passive attack with example? 

Sol//

Passive attacks:-are the nature of eavesdropping on or monitoring of transmission. The goal of the opponent is to obtain information that is being transmitted. Two types of threats resulting from passive attack, they are: 

1- Release of message contents and 

2- Traffic analysis

الهجمات السلبية:- هي ذات طبيعة التنصت على الإرسال أو مراقبة الإرسال. هدف الخصم هو الحصول على المعلومات التي يتم إرسالها. هناك نوعان من التهديدات الناتجة عن الهجوم السلبي، وهما:


1- الافراج عن محتويات الرسالة و

2- التحليل المروري


 Active attacks:-The second major category of attack is active attack. These kinds of attacks involve some modification in the data stream or the creation of false stream.Example:- Masquerade, Replay, Modification of messages, Denial of service (DoS)

الهجمات النشطة: -الفئة الرئيسية الثانية من الهجوم هي الهجوم النشط. تتضمن هذه الأنواع من الهجمات بعض التعديلات في تدفق البيانات أو إنشاء تدفق كاذب. مثال: - حفلة تنكرية، إعادة تشغيل، تعديل الرسائل، رفض الخدمة (DoS)


C. Using the algorithm of GCD to find GCD(11, 356)? Can we use 356 as a private key?

Sol//

  1. Divide the larger number by the smaller number and find the remainder. remainder=356mod11=5
  2. Replace the larger number with the smaller number and the smaller number with the remainder. 356=11×32+4
  3. Repeat this process until the remainder becomes zero. 11=4×2+3 4=3×1+1 3=1×3+0

Since the remainder has become zero, the divisor at this step (which is 1) is the GCD of 11 and 356.

So, GCD(11,356)=1.

Q4) Answer ONE of the following: (6-points)

A. Use Vigenere to cipher the message “Computer Network” using the word “maximum” as key?

Sol//

1. Write down the plaintext message and the keyword repeatedly until the length of the keyword matches the length of the plaintext message. Plaintext: C o m p u t e r N e t w o r k Keyword: m a x i m u m a x i m u m a (repeated) 2. Assign a number to each letter of the plaintext message and the keyword using the standard alphabetical numbering (A=0, B=1, ..., Z=25). Plaintext: 2 14 12 15 19 20 4 17 13 4 19 22 14 17 10 Keyword: 12 0 23 8 12 20 12 0 23 8 12 20 12 0 23 3. Add the corresponding numbers of the plaintext message and the keyword (mod 26) to get the ciphertext. Plaintext: 2 14 12 15 19 20 4 17 13 4 19 22 14 17 10 Keyword: 12 0 23 8 12 20 12 0 23 8 12 20 12 0 23 Ciphertext: 14 14 9 23 5 14 16 17 10 12 5 16 0 17 7 Therefore, the encrypted message using the Vigenère cipher with the keyword "maximum" as the key is "ONXWEOPMHLFQAGH".

B. Explain using Figure only the Encryption and Decryption in Public Key Cryptosystem?

Sol//

Encryption:

1. Public Key: Each user has a public key (PU) and a private key (PR). The public key is known to everyone and is used for encryption.

2. Plaintext Message (M): The sender wants to send a message to the receiver.

3. Encryption Algorithm (E): The sender encrypts the plaintext message (M) using the recipient's public key (PU), producing the ciphertext (C).

4. Ciphertext (C): The encrypted message (C) is sent over an insecure channel.

Decryption:

1. Private Key: The recipient has a private key (PR) that is kept secret and is used for decryption.

2. Ciphertext (C): The encrypted message (C) is received by the recipient.

3. Decryption Algorithm (D): The recipient decrypts the ciphertext (C) using their private key (PR), recovering the original plaintext message (M).

4. Plaintext Message (M): The decrypted message (M) is now available to the recipient.


This diagram illustrates the basic process of encryption and decryption in a public key cryptosystem:

This diagram illustrates the basic process of encryption and decryption in a public key cryptosystem:



(Practical Questions):

 Q1) Answer ONE of the following question: (12-points)

 A. Write Visual C# code for encrypt the following plain text:

  Plain Text: mohammed muslim

  To obtain the cipher text and the key using diagram below.

Plain ->Vigenere method with key = security ->Cipher text ->Caesar Method with key = s  

Sol//

Code 

using System;

class Program
{
    static void Main(string[] args)
    {
        string plainText = "mohammed muslim";
        string vigenereKey = "security";
        char caesarKey = 's';

        // Step 1: Apply Vigenère cipher
        string vigenereCipherText = EncryptVigenere(plainText, vigenereKey);

        // Step 2: Apply Caesar cipher
        string caesarCipherText = EncryptCaesar(vigenereCipherText, caesarKey);

        Console.WriteLine("Plain Text: " + plainText);
        Console.WriteLine("Vigenere Cipher Text: " + vigenereCipherText);
        Console.WriteLine("Caesar Cipher Text: " + caesarCipherText);
    }

    static string EncryptVigenere(string plainText, string key)
    {
        string cipherText = "";
        int keyIndex = 0;

        foreach (char c in plainText)
        {
            if (char.IsLetter(c))
            {
                char offset = char.IsUpper(c) ? 'A' : 'a';
                int plainValue = c - offset;
                int keyValue = key[keyIndex] - 'a';
                int encryptedValue = (plainValue + keyValue) % 26;
                char encryptedChar = (char)(encryptedValue + offset);
                cipherText += encryptedChar;
                keyIndex = (keyIndex + 1) % key.Length;
            }
            else
            {
                cipherText += c;
            }
        }

        return cipherText;
    }

    static string EncryptCaesar(string plainText, char key)
    {
        string cipherText = "";

        foreach (char c in plainText)
        {
            if (char.IsLetter(c))
            {
                char offset = char.IsUpper(c) ? 'A' : 'a';
                int shiftedValue = (c - offset + (key - 'a')) % 26;
                char encryptedChar = (char)(shiftedValue + offset);
                cipherText += encryptedChar;
            }
            else
            {
                cipherText += c;
            }
        }

        return cipherText;
    }
}




































B. Write Visual C# code for encrypt the following plain text: 

ماهي هجمات حجب الخدمة ؟؟ :Text Plain  

 To obtain the cipher text using diagram below. Note, the key is entered by user. 

Plain ->Vernam method ->Cipher text ->Vernam method

Sol//

Code 

using System;

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("Enter the encryption key:");
        string key = Console.ReadLine();

        string plainText = "ماهي هجمات حجب الخدمة ؟؟";

        // Step 1: Apply Vernam cipher
        string vernamCipherText = EncryptVernam(plainText, key);

        // Step 2: Apply Vernam cipher again
        string finalCipherText = EncryptVernam(vernamCipherText, key);

        Console.WriteLine("Plain Text: " + plainText);
        Console.WriteLine("Vernam Cipher Text: " + vernamCipherText);
        Console.WriteLine("Final Cipher Text: " + finalCipherText);
    }

    static string EncryptVernam(string plainText, string key)
    {
        string cipherText = "";

        for (int i = 0; i < plainText.Length; i++)
        {
            char plainChar = plainText[i];
            char keyChar = key[i % key.Length];
            char encryptedChar = (char)(plainChar ^ keyChar);
            cipherText += encryptedChar;
        }

        return cipherText;
    }
}







































إرسال تعليق

ملفات تعريف الارتباط
نستخدم ملفات تعريف الارتباط (Cookies) لفهم كيفية استخدامك لموقعنا وتحسين تجربتك في المحتوى والإعلانات. باستمرارك في تصفح الموقع، فإنك توافق على استخدامنا لملفات تعريف الارتباط وفقًا لسياسة الخصوصية لدينا.
أُووبس!
يبدو أن هناك خطأ ما في اتصالك بالإنترنت. يرجى الاتصال بالإنترنت وبدء التصفح مرة أخرى.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.