2081

CSC327 · TU past paper

Cryptography 2081 question paper

The complete TU 2081 exam paper for Cryptography (CSC327), all 12 questions with solved model answers written to the mark scheme.

Tap a question to open its answer.

  1. 1NumericalInternational Data Encryption StandardAnswer

    Tracing the First Full Round of IDEA Algorithm

    IDEA (International Data Encryption Algorithm) is a symmetric block cipher that operates on 64-bit plaintext blocks using a 128-bit key, performing 8 identical rounds with operations: multiplication modulo $2^{16}+1$, addition modulo $2^{16}$, and XOR.

    Subkeys (4-bit each): - $K1 = 1100 = 12$ - $K2 = 1010 = 10$ - $K3 = 0000 = 0$ - $K4 = 1111 = 15$ - $K5 = 0101 = 5$ - $K6 = 1001 = 9$ Input plaintext blocks (4-bit each): - $X1 = 1011 = 11$ - $X2 = 1110 = 14$ - $X3 = 1011 = 11$ -

  2. 210 marksMessage Authentication CodesAnswer

    What is Message Authentication Code? List the operation of computing digest value in different passes of MD4. Describe about Needhom-Schroeder protocol.[10]

    --- Definition: A Message Authentication Code (MAC) is a function of the message and a secret key that produces a fixed-length value that serves as the authenticator. Working Principle: - This technique assumes that the sender and receiv...

  3. 310 marksNumericalDiffie-Helman Key ExchangeAnswer

    Why do we need discrete logarithm? Illustrate with an example. Consider a Diffie-Hellman scheme with a common prime p = 13 between user A and user B. Suppose public key of A is 10 and public key of B is 8. Now determine their private keys and shared secret key. Select any valid primitive root of 13.[10]

    • Common prime: $p = 13$ - Public key of A: $YA = 10$ - Public key of B: $YB = 8$ - Task: find private keys $XA, XB$ and shared secret $K$, using any valid primitive root of 13. --- Definition. Given a prime $p$, a primitive root $g$, an...
  4. 45 marksNumericalSubstitution TechniquesAnswer

    Show the encryption of plain text "ALGORITHM" using the key "PSEUDOCODE" using playfair cipher. [5]

    Playfair Cipher: Encryption of "ALGORITHM" using key "PSEUDOCODE"

    Step 1 - EXTRACT: Given Data

    • Plaintext: ALGORITHM
    • Key: PSEUDOCODE
    • Convention: I/J share one cell (standard Playfair)

    Step 2 - SOLVE

    Construct the 5x5 Matrix

    Key: P S E U D O C O D E

    Remove duplicates (keep first occurrence): P, S, E, U, D, O, C
    (The second O, D, E are dropped.)

    Fill remaining letters A, B, F, G, H, I/J, K, L, M, N, Q, R, T, V, W, X, Y, Z:

    Col1Col2Col3Col4Col5
    Row1PSEUD
    Row2OCABF
    Row3GHI/JKL
    Row4MNQRT
    Row5VWXYZ

    Prepare Digrams

    Plaintext: A L G O R I T H M

    No double letters within pairs. M is left alone, pad with X:

    $$AL \mid GO \mid RI \mid TH \mid MX$$

    Apply Rules

    AL: A(2,3), L(3,5) → rectangle → A→(2,5)=F, L→(3,3)=I → FI

    GO: G(3,1), O(2,1) → same column → G→(4,1)=M, O→(3,1)=G → MG

    RI: R(4,4), I(3,3) → rectangle → R→(4,3)=Q, I→(3,4)=K → QK

    TH: T(4,5), H(3,2) → rectangle → T→(4,2)=N, H→(3,5)=L → NL

    MX: M(4,1), X(5,3) → rectangle → M→(4,3)=Q, X→(5,1)=V → QV

    Final Ciphertext

    DigramCipher
    ALFI
    GOMG
    RIQK
    THNL
    MXQV

    $$\boxed{\text{Ciphertext} = \text{FIMGQKNLQV}}$$

  5. 55 marksKerberos ProtocolAnswer

    Discuss the working mechanism of kerberos protocol. [5]

    Kerberos is a computer network authentication protocol that works on the basis of tickets to allow nodes communicating over a non-secure network to prove their identity to one another in a secure manner. It is based on the concept of a t...

  6. 65 marksFirewalls and their typesAnswer

    What is the use of firewall? How circuit level gateway differs from stateful inspection firewall? [5]

    A firewall is a network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules. Its main uses include: - Access Control: Blocks unauthorized access to the internal network w...

  7. 75 marksIntrusion Detection SystemAnswer

    What is intrusion? Explain any two types of intrusion detection system. [5]

    Intrusion and Intrusion Detection Systems

    What is Intrusion?

    Intrusion detection is the process of identifying and responding to malicious activity targeted at a resource. An intrusion refers to any unauthorized attempt to access, manipulate, or compromise a system's resources, data, or services.

    An Intrusion Detection System (IDS) is a system designed to test/analyze network system traffic/events against a given set of parameters and alert/capture data when these thresholds are met. IDS uses collected information and pre-defined knowledge-based systems to reason about the possibility of an intrusion. It also provides services to cope with intrusion such as giving alarms and activating programs to deal with intrusion.


    Two Types (Approaches) of Intrusion Detection System

    1. Statistical Anomaly Detection

    Statistical anomaly detection involves the collection of data relating to the behaviours of legitimate users over a period of time. Then statistical tests are applied to observed behaviour to determine with a high level of confidence whether the behaviour is that of a legitimate user or not.

    It falls into two broad categories:

    • Threshold Detection:

      • Involves counting the number of occurrences of a specified event type over an interval of time.
      • If the count exceeds a reasonable number, an intrusion is assumed.
      • Example: Too many failed login attempts within a short time.
    • Profile-Based Anomaly Detection:

      • Focuses on characterizing the past behaviour of individual users or related groups of users.
      • Significant deviations from the established profile are flagged as potential intrusions.

    2. Rule-Based Detection

    Rule-based detection involves an attempt to define a set of rules that can be used to decide whether a given behaviour is that of an intruder.

    It falls into two broad categories:

    • Rule-Based Anomaly Detection:

      • Historical audit records are analyzed to identify usage patterns.
      • Rules are generated automatically to describe those patterns.
      • Any behaviour that deviates from these rules is flagged as suspicious.
    • Rule-Based Penetration Identification:

      • Uses rules for identifying known penetrations or penetrations that would exploit known weaknesses.
      • Rules are typically defined by security experts based on known attack signatures.
      • Example: A rule that detects a specific sequence of commands known to exploit a vulnerability.

    Summary Table:

    ApproachBasisMethod
    Statistical Anomaly DetectionBehaviour deviation from normalThreshold / Profile-based
    Rule-Based DetectionPredefined rulesAnomaly rules / Penetration rules
  8. 85 marksNumericalFinite FieldsAnswer

    Find the multiplicative inverse of polynomial (95) using extended euclidean Algorithm. [5]

    Multiplicative Inverse in GF(2⁸) using the Extended Euclidean Algorithm

    Step 1 - EXTRACT (Given data)

    • Element to invert: 95 (hexadecimal), interpreted as an element of $GF(2^8)$.
    • $95_{16} = 1001,0101_2$, giving polynomial

    $$b(x) = x^7 + x^4 + x^2 + 1$$

    • AES irreducible (reduction) polynomial:

    $$m(x) = x^8 + x^4 + x^3 + x + 1$$

    Note: The question only states "95" and "extended Euclidean algorithm". The irreducible polynomial is not explicitly given; the AES standard modulus is assumed since this is the standard BIT/cryptography context.

    Goal: find $b(x)^{-1} \bmod m(x)$.


    Step 2 - SOLVE

    All arithmetic is in $GF(2)$ (addition = XOR).

    Initialize:

    • $r_0 = m(x)=x^8+x^4+x^3+x+1$, $; t_0=0$
    • $r_1 = b(x)=x^7+x^4+x^2+1$, $; t_1=1$

    Recurrence: $r_{i+1}=r_{i-1}-q_i r_i$, $;t_{i+1}=t_{i-1}-q_i t_i$.

    Division 1: $r_0 \div r_1$

    $$x^8+x^4+x^3+x+1 ;=; x\cdot(x^7+x^4+x^2+1) + r_2$$

    $x\cdot b = x^8+x^5+x^3+x$. XOR:

    $$r_2 = (x^8+x^4+x^3+x+1)\oplus(x^8+x^5+x^3+x)=x^5+x^4+1$$

    • $q_1=x$
    • $t_2=t_0-q_1t_1 = 0 - x\cdot1 = x$

    Division 2: $r_1 \div r_2$

    Divide $x^7+x^4+x^2+1$ by $x^5+x^4+1$:

    • $x^2$: $x^2(x^5+x^4+1)=x^7+x^6+x^2$; XOR → $x^6+x^4+1$
    • $x$: $x(x^5+x^4+1)=x^6+x^5+x$; XOR → $x^5+x^4+x+1$
    • $1$: $x^5+x^4+1$; XOR → $x$

    So:

    • $q_2=x^2+x+1$, $; r_3=x$
    • $t_3=t_1-q_2t_2 = 1 - (x^2+x+1)(x) = 1+(x^3+x^2+x)=x^3+x^2+x+1$

    Division 3: $r_2 \div r_3$

    Divide $x^5+x^4+1$ by $x$:

    $$x^5+x^4+1 = x\cdot(x^4+x^3)+1$$

    So:

    • $q_3=x^4+x^3$, $; r_4=1$
    • $t_4=t_2-q_3t_3 = x - (x^4+x^3)(x^3+x^2+x+1)$

    Compute $(x^4+x^3)(x^3+x^2+x+1)$:

    $x^4\cdot(x^3+x^2+x+1)=x^7+x^6+x^5+x^4$ $x^3\cdot(x^3+x^2+x+1)=x^6+x^5+x^4+x^3$

    XOR (add): $x^6\oplus x^6=0$, $x^5\oplus x^5=0$, $x^4\oplus x^4=0$:

    $$=x^7+x^3$$

    Then:

    $$t_4 = x \oplus (x^7+x^3) = x^7+x^3+x$$

    Since $r_4 = 1 = \gcd$, the inverse of $b(x)$ modulo $m(x)$ is $t_4$.

    Verification

    $$b(x)^{-1} = x^7 + x^3 + x$$

    Check $b(x)\cdot t_4 \bmod m(x)$:

    $b = x^7+x^4+x^2+1$, $t_4=x^7+x^3+x$.

    Product:

    • $x^7\cdot t_4 = x^{14}+x^{10}+x^8$
    • $x^4\cdot t_4 = x^{11}+x^7+x^5$
    • $x^2\cdot t_4 = x^9+x^5+x^3$
    • $1\cdot t_4 = x^7+x^3+x$

    XOR all: $x^5\oplus x^5=0$, $x^7\oplus x^7=0$, $x^3\oplus x^3=0$:

    $$= x^{14}+x^{11}+x^{10}+x^9+x^8+x$$

    Reduce mod $m(x)=x^8+x^4+x^3+x+1$ (i.e. $x^8\equiv x^4+x^3+x+1$):

    • $x^8\equiv x^4+x^3+x+1$

    • $x^9\equiv x^5+x^4+x^2+x$

    • $x^{10}\equiv x^6+x^5+x^3+x^2$

    • $x^{11}\equiv x^7+x^6+x^4+x^3$

    • $x^{14}=x^6\cdot x^8\equiv x^6(x^4+x^3+x+1)=x^{10}+x^9+x^7+x^6$

      reduce: $x^{10}\to x^6+x^5+x^3+x^2$, $x^9\to x^5+x^4+x^2+x$ $x^{14}\equiv (x^6+x^5+x^3+x^2)+(x^5+x^4+x^2+x)+x^7+x^6$ $= x^7+x^4+x^3+x$

    Sum all reduced terms (XOR):

    termreduced
    $x^{14}$$x^7+x^4+x^3+x$
    $x^{11}$$x^7+x^6+x^4+x^3$
    $x^{10}$$x^6+x^5+x^3+x^2$
    $x^9$$x^5+x^4+x^2+x$
    $x^8$$x^4+x^3+x+1$
    $x$$x$

    XOR column by column:

    • $x^7$: $1+1=0$
    • $x^6$: $1+1=0$
    • $x^5$: $1+1=0$
    • $x^4$: $1+1+1+1=0$
    • $x^3$: $1+1+1+1=0$
    • $x^2$: $1+1=0$
    • $x^1$: $1+1+1+1=0$
    • $x^0$: $1$

    $$= 1 \checkmark$$

    Final Answer

    $$\boxed{b(x)^{-1} = x^7 + x^3 + x}$$

    In binary: $1000,1010$, i.e. hexadecimal 8A.

    Completing the computation through $t_4$ gives the inverse $x^7+x^3+x$, which multiplies back to $1$.

  9. 95 marksAnswer

    What is DoS attack? Discuss about PKI trust model. [5]

    DoS Attack and PKI Trust Model


    Denial of Service (DoS) Attack:

    "Denial of service prevents the normal use or management of communication facilities."

    A Denial of Service (DoS) attack is a type of active attack in which an attacker attempts to make a system, network, or service unavailable to its intended users by overwhelming or disabling it.

    Key Characteristics:

    • It is classified under active attacks in network security.
    • The attacker does not steal or alter data but rather disrupts availability.
    • It targets one of the core security goals: Availability.

    Forms of DoS Attack:

    FormDescription
    Targeted AttackDisrupts a specific service or host (e.g., crashing a web server)
    Network DisruptionDisabling the entire network or overloading it with messages to degrade performance

    Example:

    An attacker floods a web server with thousands of fake requests per second, causing it to become unresponsive to legitimate users. This is known as a flood-based DoS attack.


    PKI Trust Model

    Public Key Infrastructure (PKI) is a framework that manages digital certificates and public-key encryption to enable secure communication. A PKI Trust Model defines how trust is established and distributed among entities in a PKI system.

    Core Components of PKI:

    • Certificate Authority (CA): Issues and signs digital certificates.
    • Registration Authority (RA): Verifies identity before certificate issuance.
    • Digital Certificate: Binds a public key to an entity's identity.
    • Certificate Revocation List (CRL): Lists revoked certificates.

    Types of PKI Trust Models:

    1. Single CA (Monopoly) Model

    • One single root CA is trusted by all entities.
    • Simple but single point of failure.
    • If the root CA is compromised, the entire system fails.
            [Root CA]
           /    |    \
        User1  User2  User3
    

    2. Hierarchical Trust Model

    • A root CA sits at the top and delegates trust to subordinate CAs.
    • Subordinate CAs issue certificates to end users.
    • Most widely used model (e.g., SSL/TLS on the internet).
             [Root CA]
            /          \
      [Sub CA1]      [Sub CA2]
       /     \         /    \
    User1  User2   User3   User4
    
    • Trust flows top-down.
    • If you trust the Root CA, you trust all certificates issued under it.

    3. Web of Trust Model

    • Used in PGP (Pretty Good Privacy).
    • There is no central CA; users sign each other's public keys.
    • Trust is distributed and peer-based.
    • Example: If Alice trusts Bob, and Bob trusts Carol, Alice may transitively trust Carol.

    4. Cross-Certification Model

    • Two separate CA hierarchies mutually certify each other.
    • Allows users from different organizations to trust each other.
    [CA1] <----cross certify----> [CA2]
      |                              |
    Users of Org A              Users of Org B
    

    Summary Table:

    Trust ModelCentral AuthorityScalabilityUse Case
    Single CAYesLowSmall systems
    HierarchicalYes (Root CA)HighInternet (SSL/TLS)
    Web of TrustNoMediumPGP email
    Cross-CertificationMutualMediumInter-organization

    Conclusion:

    A DoS attack disrupts the availability of services, while PKI trust models provide a structured way to establish and manage trust in public key cryptography. Both concepts are fundamental to understanding network security.

  10. 105 marksNumericalSubstitution TechniquesAnswer

    Using Vigenere cipher with key = “worlds”, encrypt the plain text “hello everyone”. [5]

    • Plaintext: hello everyone → letters only: helloeveryone (13 letters) - Key: worlds - Formula: $Ci = (Pi + Ki) \bmod 26$, with A=0, ..., Z=25 Pos 1 2 3 4 5 6 7 8 9 10 11 12 13 ------------------------------------------------ P h e l l o...
  11. 115 marksModes of Block Cipher EncryptionsAnswer

    Describe the different modes of block cipher. [5]

    A block cipher encrypts a fixed-size block of plaintext into a block of ciphertext using a key. However, most real-world messages are longer than a single block, so different modes of operation define how to apply the block cipher repeat...

  12. 125 marksProperties of Hash functionsAnswer

    Write short notes on (any two) a. Totient value of any positive integer. b. Properties of hash function. c. Virus or Worms. [5]

    Short Notes (Any Two)


    a. Totient Value of Any Positive Integer

    Definition: Euler's Totient Function, denoted by φ(n), is defined as the number of positive integers less than n that are relatively prime (coprime) to n. Two numbers are relatively prime if their greatest common divisor (GCD) is 1.

    Special Property: If n is a prime number, then:

    φ(n) = n - 1

    This is because all integers from 1 to (n-1) are relatively prime to a prime number.

    Example: Find φ(10):

    • Numbers less than 10: {1, 2, 3, 4, 5, 6, 7, 8, 9}
    • Numbers relatively prime to 10 (GCD with 10 = 1): {1, 3, 7, 9}
    • Therefore, φ(10) = 4

    Example with prime: Find φ(7):

    • Since 7 is prime: φ(7) = 7 - 1 = 6

    Euler's Totient Function is widely used in RSA encryption and number theory in cryptography.


    b. Properties of Hash Function

    Definition: A hash function is a function that maps a message of any length into a fixed-length hash value, which serves as the authenticator in message authentication and digital signatures.

    Key Properties:

    PropertyDescription
    One-way PropertyGiven a hash value h, it is computationally infeasible to find any message m such that H(m) = h.
    Weak Collision ResistanceGiven an input m1, it is computationally hard to find a different input m2 such that H(m1) = H(m2).
    Strong Collision ResistanceIt is computationally hard to find any two different messages m1 and m2 such that H(m1) = H(m2).
    Fixed-length OutputRegardless of input size, the hash function always produces a fixed-length output (e.g., MD5 produces 128-bit output).
    Variable Input SizeA hash function can be applied to a block of data of any size.

    Example:

    • MD5 produces a 128-bit (16-byte) hash value expressed as a 32-digit hexadecimal number.
    • MD4 also produces a 128-bit message digest from an input of arbitrary length.

    Hash functions play a fundamental role in efficient and secure information processing in cryptography.