Chapter 1
Cryptography
TU BSc CSIT past exam questions
Past questions and answers
72 questions set from this chapter. Most repeated first.
- 2076 · 10 marks
Among monoalphabetic and polyalphabetic cipher, which one is more vulnerable? Justify your statement. Which types of keys are considered weak keys in DES? Explain the round operation in IDEA.
Answer
Monoalphabetic vs polyalphabetic cipher
A monoalphabetic cipher (Caesar, general substitution) maps each plaintext letter to one fixed ciphertext letter throughout the message. A polyalphabetic cipher (Vigenere, Vernam) uses several substitution alphabets chosen by the key, so the same plaintext letter can become different ciphertext letters.
The monoalphabetic cipher is more vulnerable. Justification:
- It preserves the letter frequency distribution of the language. In English, E, T, A, O are the most common; the most frequent ciphertext letter is probably E, the next T, and so on. Frequency analysis, together with digraph/trigraph patterns (TH, HE, THE), breaks it quickly.
- The key space of a simple Caesar cipher is only 25, and even the general substitution (26! keys) falls to frequency analysis.
- In a polyalphabetic cipher the frequencies are flattened, because one plaintext letter is spread over several ciphertext letters. It can still be attacked (Kasiski test, index of coincidence) but only after finding the key length, so it is much harder.
Weak keys in DES
DES derives 16 subkeys from the 56-bit key. A key is weak if all 16 subkeys are identical. Then encryption equals decryption: . There are 4 weak keys (in hex, with parity bits):
- 0101010101010101
- FEFEFEFEFEFEFEFE
- E0E0E0E0F1F1F1F1
- 1F1F1F1F0E0E0E0E
They arise when the two 28-bit halves , are all 0s or all 1s, so the rotations never change them. Semi-weak keys (12 keys, 6 pairs) are also avoided: they generate only two distinct subkeys, and one key of a pair decrypts what the other encrypts, .
Round operation in IDEA
IDEA works on 64-bit blocks with a 128-bit key and has 8 identical rounds plus an output transformation. The block is split into four 16-bit sub-blocks . Each round uses six 16-bit subkeys and three incompatible operations: XOR (), addition mod (), and multiplication mod ().
- Output of the round: . The two middle blocks are swapped before the next round (not after the last round).
Steps 5 to 8 form the multiplication-addition (MA) structure. After round 8 the output transformation uses four more subkeys: , , , . In total subkeys are used. They come from the 128-bit key: the first 8 subkeys are the key split into 16-bit pieces, then the key is rotated left by 25 bits and split again, and so on.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 10 marks
State Fermat’s theorem with an example. Given the prime number p=29 and its primitive root g=8, private key sender with X=9 and random integer K=11, encrypt the message m=13 using ElGamal cryptosystem.
Answer
Fermat's little theorem
If is prime and is an integer not divisible by , then Equivalently for every integer .
Example: , : , so .
ElGamal encryption
Given , , private key , random , message .
Public key: .
, , , so .
Ciphertext pair :
. So .
, , , so . ; . So .
.
Ciphertext = (3, 12).
Check by decryption: (same as ). since . . Correct.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 10 marks
Compare the SHA parameters between SHA-1 and SHA-2 families. Decrypt the cipher text DRJI with the key (\begin{pmatrix}7 & 8\ 11 & 11\end{pmatrix}) using the Hill cipher.
Answer
Comparison of SHA-1 and SHA-2 parameters
| Parameter | SHA-1 | SHA-224 | SHA-256 | SHA-384 | SHA-512 |
|---|---|---|---|---|---|
| Message digest size (bits) | 160 | 224 | 256 | 384 | 512 |
| Message size limit (bits) | |||||
| Block size (bits) | 512 | 512 | 512 | 1024 | 1024 |
| Word size (bits) | 32 | 32 | 32 | 64 | 64 |
| Number of steps | 80 | 64 | 64 | 80 | 80 |
| Security (collision, bits) | below 63 (broken) | 112 | 128 | 192 | 256 |
SHA-1 is considered broken for collision resistance, so SHA-2 is preferred. SHA-2 has a larger digest, a more complex message schedule and round function.
Hill cipher decryption of DRJI
Key .
. Since the key is invertible. because .
Check: first row of times first column of : . Correct.
Ciphertext pairs: DR = (3, 17), JI = (9, 8).
(column vectors):
- DR: (H); (E).
- JI: (L); (L).
Plaintext = HELL
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
Define discrete logarithm. Explain the procedure of sharing the secret key in Diffie Hellman.
Answer
Discrete logarithm
Let be prime and a primitive root of . For any with there is a unique exponent () such that The exponent is the discrete logarithm of to base modulo , written . Computing from is easy (fast modular exponentiation), but finding from is computationally hard for large . This one-way property secures Diffie-Hellman, ElGamal and DSA.
Diffie-Hellman key exchange
Public parameters: a large prime and a primitive root of .
- Alice picks a secret and computes the public value .
- Bob picks a secret and computes .
- They exchange and over the open channel.
- Alice computes ; Bob computes .
Both get the same key since .
Example: , , , . , . and .
An eavesdropper sees but would need a discrete logarithm to get or . The basic protocol does not authenticate the parties, so it is open to a man-in-the-middle attack.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
Distinguish between stream cipher and block cipher. Encrypt the message WE ARE IN SAME RACE UNTILL OVER LIVE END using Rail fence cipher using 4 as a number of rails.
Answer
Stream cipher vs block cipher
| Stream cipher | Block cipher |
|---|---|
| Encrypts one bit or byte at a time | Encrypts a fixed-size block (64 or 128 bits) at a time |
| Key stream is XORed with plaintext | Plaintext block is passed through substitution and permutation rounds |
| Fast, small hardware, low delay | Slower, more complex |
| Suited to real-time data (voice, wireless) | Suited to files, stored data and bulk encryption |
| Key stream must never be reused | Modes (CBC, CTR) are needed to handle long messages |
| Examples: RC4, A5/1, ChaCha | Examples: DES, AES, IDEA |
Rail fence encryption (4 rails)
Plaintext without spaces: WEAREINSAMERACEUNTILLOVERLIVEEND (32 letters).
Writing the letters in a zigzag over 4 rails:
- Rail 1: W N A I R N (positions 1, 7, 13, 19, 25, 31)
- Rail 2: E I S R C T L E L E D
- Rail 3: A E A E E N L V I E
- Rail 4: R M U O V
Reading the rails one after another:
WNAIRN + EISRCTLELED + AEAEENLVIE + RMUOV
Ciphertext = WNAIRNEISRCTLELEDAEAEENLVIERMUOV
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
Define digital signature. Describe the approaches of DSS.
Answer
Digital signature
A digital signature is a value computed from a message and the signer's private key which lets anyone check, with the signer's public key, that the message came from the signer and was not changed. It gives authentication, integrity and non-repudiation.
Approaches of the Digital Signature Standard (DSS)
DSS (FIPS 186) uses the SHA hash with a public-key signature algorithm. It specifies two approaches.
-
RSA approach. The message is hashed with SHA to a fixed-length digest. The digest is encrypted (signed) with the sender's private RSA key. The receiver recomputes the hash of the received message, decrypts the signature with the sender's public key, and compares the two. A match means the signature is valid. This follows the generic hash-then-sign model.
-
DSA approach (Digital Signature Algorithm). DSA is based on the discrete logarithm problem (ElGamal and Schnorr ideas) and can only sign, not encrypt. Global parameters are a prime , a prime divisor of , and . The private key is and the public key is .
- Signing: pick a random ; compute and . The signature is .
- Verifying: compute , , , . The signature is valid if .
In DSA the hash and a fresh random are fed into the signing function, so the same message gives different signatures each time. must never be reused or revealed.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
What is the task of a firewall? List the elements of X.509.
Answer
Task of a firewall
A firewall is a system placed between a trusted internal network and an untrusted external network (the Internet). It forces all traffic in both directions to pass through it, and only traffic allowed by the local security policy is passed. Its tasks are:
- Filter packets by IP address, port and protocol (access control).
- Block unauthorized access and hide internal network structure (NAT).
- Log and audit traffic, and raise alarms for suspicious activity.
- Provide a single point for enforcing security policy and for VPN or proxy services.
A firewall itself should be immune to penetration. It cannot protect against attacks that bypass it (dial-up modems, infected laptops) or against insiders.
Elements of an X.509 certificate
- Version
- Certificate serial number
- Signature algorithm identifier (algorithm and parameters used to sign)
- Issuer name (the certification authority)
- Validity period (not before, not after)
- Subject name (the owner of the public key)
- Subject public key information (algorithm, parameters, key)
- Issuer unique identifier (optional, version 2)
- Subject unique identifier (optional, version 2)
- Extensions (version 3)
- Signature (the CA's digital signature over all the above fields)
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
How does the nature of worms differ from viruses? Define PKI with its architecture model.
Answer
Worms vs viruses
| Virus | Worm |
|---|---|
| Needs a host program or file to attach to | Standalone program that needs no host |
| Spreads only when the infected file is run or shared by a user | Spreads by itself over networks, exploiting vulnerabilities, e-mail, shares |
| Mainly damages or corrupts files on the infected machine | Mainly consumes bandwidth and resources, creates backdoors, and can carry a payload |
| Replicates by inserting its code into other files | Replicates by copying itself to other machines |
| Example: Jerusalem, CIH | Example: Morris worm, Code Red, Slammer |
Public Key Infrastructure (PKI)
PKI is the set of hardware, software, people, policies and procedures needed to create, manage, distribute, use, store and revoke digital certificates, so that public keys can be bound to identities and trusted.
PKI architecture model
- End entities (subscribers): users, servers or devices that hold certificates and use them.
- Registration Authority (RA): verifies the identity of the applicant and forwards the request to the CA.
- Certification Authority (CA): issues, signs and revokes X.509 certificates. CAs form a hierarchy with a trusted root CA at the top and subordinate CAs below, each certified by its parent.
- Repository (directory, such as LDAP): stores certificates and Certificate Revocation Lists (CRLs) so that they can be retrieved.
- Certificate Revocation List / OCSP: tells relying parties which certificates are no longer valid.
- Relying party: verifies a certificate by checking the CA signature up the chain to a trusted root, and checks validity and revocation.
Process: the user generates a key pair and sends a request to the RA, the RA verifies identity, the CA issues a signed certificate and publishes it in the repository, and others use it to verify signatures or encrypt data for the user.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
Explain the procedure of mix column transformation in AES with an example.
Answer
MixColumns transformation in AES
MixColumns operates on each of the four columns of the state independently. Each column is treated as a vector of four bytes and is multiplied by a fixed matrix, with arithmetic in using the irreducible polynomial (hex 11B):
Addition is XOR. Multiplication by 01 leaves the byte unchanged. Multiplication by 02 is a left shift by one bit, followed by XOR with 1B if the top bit of the original byte was 1. Multiplication by 03 is . MixColumns gives diffusion: each output byte depends on all four input bytes of its column. It is omitted in the last round.
Example. Column .
- : , top bit is 1, shift gives , XOR 1B gives . .
- , .
- , .
- , .
First output byte: .
Likewise , , .
Output column: .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
What is the role of the prime number in the Euler totient Function? Find the GCD of 12 and 16 using the Euclidean algorithm.
Answer
Role of the prime number in Euler's totient function
Euler's totient is the count of integers in that are relatively prime to .
- For a prime , every number is coprime to , so .
- For with distinct primes, .
- For a prime power, .
Because of this, is easy to compute when the prime factors are known and hard when they are not. RSA relies on this: with , and Euler's theorem makes decryption work. Fermat's theorem is the special case .
GCD(12, 16) by the Euclidean algorithm
The last non-zero remainder is 4.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
Write down any two limitations of MAC. What do policy and mechanism mean in cryptography? Describe with a scenario.
Answer
Two limitations of MAC (message authentication code)
- No non-repudiation. The MAC key is shared by sender and receiver, so either could have produced the tag. A third party cannot tell who created the message, which a digital signature can show.
- Key distribution and management. Both parties must share a secret key in advance, and for users keys are required. A compromised key lets an attacker forge messages. (A MAC also gives authentication and integrity but not confidentiality.)
Policy and mechanism
- A security policy states what is allowed and what is not: it defines the secure and non-secure states of a system. It says "what" is to be protected.
- A security mechanism is the method, tool or procedure used to enforce the policy, for example encryption, passwords, access control lists, firewalls. It says "how".
Scenario: a university's policy says "only the registered teacher of a course may change the marks of its students, and students may only view their own marks". The mechanisms that enforce this are user login with password or OTP (authentication), an access control list on the marks database (authorization), encryption of the connection with TLS, and audit logs. If a mechanism cannot enforce the policy (for example any logged-in user can edit any marks), the system is not secure with respect to the policy.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2076 · 5 marks
Write short notes on
- Classes of Intruder
- SSL
- DoS Attack
Answer
1. Classes of intruder
Anderson classified intruders into three classes:
- Masquerader: an outsider (not authorized to use the system) who penetrates access controls and uses a legitimate user's account, for example with a stolen password.
- Misfeasor: a legitimate user who accesses data, programs or resources they are not authorized for, or who misuses their privileges.
- Clandestine user: a person (inside or outside) who seizes supervisory control of the system and uses it to evade auditing and access control, or to suppress audit collection.
2. SSL (Secure Sockets Layer)
SSL (now succeeded by TLS) is a protocol that gives secure communication between client and server on top of TCP, widely used with HTTPS. It provides confidentiality (symmetric encryption), message integrity (MAC), and server (optionally client) authentication using X.509 certificates. It has two layers: the Record Protocol (fragmentation, compression, MAC, encryption) and the upper protocols (Handshake, Change Cipher Spec, Alert). The handshake negotiates the cipher suite, authenticates the server, and establishes a shared session key.
3. DoS attack
A Denial of Service attack tries to make a system, service or network unavailable to its legitimate users by exhausting resources such as bandwidth, memory or CPU. Common forms are SYN flooding (half-open TCP connections), ping flood or smurf (ICMP amplification), and UDP flood. In a Distributed DoS (DDoS) the traffic comes from many compromised machines (a botnet), which makes it hard to block. Countermeasures include rate limiting, ingress filtering, SYN cookies, firewalls/IPS and traffic scrubbing services.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 10 marks
Define CIA triad. State the encryption process of double and triple DES. What is the task of S-Box in DES ? Discuss with an example.
Answer
CIA triad
The CIA triad is the three core goals of information security:
- Confidentiality: information is disclosed only to authorized parties (encryption, access control).
- Integrity: information and systems are modified only in authorized ways, and changes are detectable (hashes, MACs, digital signatures).
- Availability: information and services are accessible to authorized users when needed (redundancy, backups, DoS protection).
Double DES
Two DES stages with two independent 56-bit keys : The effective key length looks like 112 bits, but the meet-in-the-middle attack (encrypt with all , decrypt with all , look for a match) needs only about operations. So double DES gives about 57 bits of security.
Triple DES (3DES)
Three DES operations in encrypt-decrypt-encrypt (EDE) order with keys (or for the two-key version): With it reduces to single DES, giving backward compatibility. The effective strength is 112 bits (168 bits nominal).
S-box in DES
After the expansion permutation, the 48-bit value is XORed with the 48-bit round subkey and split into eight 6-bit groups. Each group enters one of eight S-boxes (), each of which maps 6 bits to 4 bits, giving 32 bits. The S-boxes are the only non-linear step of DES and give confusion.
Method: the outer two bits (first and last) select the row (0 to 3) and the middle four bits select the column (0 to 15).
Example: input to . Row bits . Column bits . Row 1 of is 0 15 7 4 14 2 13 1 10 6 12 11 9 5 3 8; entry 13 is 5. Output . So the 6-bit input becomes the 4-bit output .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 10 marks
Explain the generic model of digital signature process. Consider the two prime numbers 7 and 19. Select 29 as public key and 41 as private key. Encrypt the plaintext 4 and decrypt the cipher text 3 using RSA.
Answer
Generic model of the digital signature process
- Signing (sender A). The message is passed through a hash function to get a fixed-length digest . The digest is encrypted with A's private key to give the signature . A sends together with (optionally, is also encrypted for confidentiality).
- Verification (receiver B). B hashes the received message to get . B also decrypts with A's public key to recover . If the two digests are equal, the signature is valid.
Thus B knows that the message came from A (authentication), that it was not altered (integrity), and A cannot deny sending it (non-repudiation). Only A's private key could produce a signature that A's public key verifies.
RSA
, , so and . Public key , private key . Check: , so . Valid.
Encrypt plaintext 4: .
; ; ; : , so .
: . . . .
Decrypt ciphertext 3: .
; ; (); ; ().
: . , .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 10 marks
Define Galois field with an example. Explain any two modes of block cipher encryption. Deterimine the quadratic residues of 7.
Answer
Galois field
A Galois field is a finite set of elements in which addition, subtraction, multiplication and division (by non-zero elements) are defined and satisfy the field axioms. It exists only when for a prime . For , is the integers with arithmetic mod . For the elements are polynomials of degree below with coefficients in , with arithmetic mod an irreducible polynomial.
Example: : , , so . AES uses with the irreducible polynomial .
Two modes of block cipher encryption
-
Electronic Codebook (ECB). Each plaintext block is encrypted independently with the same key: . Decryption: . It is simple and parallelizable, and an error affects only one block. But identical plaintext blocks give identical ciphertext blocks, so patterns leak; it is suitable only for short data such as keys.
-
Cipher Block Chaining (CBC). Each plaintext block is XORed with the previous ciphertext block before encryption: The IV is random and sent with the message. Identical plaintext blocks give different ciphertext, so patterns are hidden. Encryption is sequential; a bit error in garbles and flips the same bit in .
Quadratic residues of 7
is a quadratic residue mod 7 if has a solution with .
| 1 | 2 | 3 | 4 | 5 | 6 | |
|---|---|---|---|---|---|---|
| 1 | 4 | 2 | 2 | 4 | 1 |
The quadratic residues of 7 are ; the non-residues are .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
What does intrusion mean? How the system detect intrusion? List any four types of firewall.
Answer
Intrusion
An intrusion is an unauthorized attempt to access, misuse or damage a system or network, or to violate its security policy. It can be an outsider breaking in, or an insider abusing privileges (masquerader, misfeasor, clandestine user).
How a system detects intrusion
An Intrusion Detection System (IDS) works on the assumption that intruder behaviour differs from legitimate behaviour. Two main approaches:
- Statistical anomaly detection: a profile of normal behaviour (login times, commands used, resources consumed) is built for each user. Activity that deviates significantly from the profile is flagged. It can detect new attacks, but may give false positives.
- Rule-based (signature / misuse) detection: audit records are compared with a set of known attack signatures or rules (for example, repeated failed logins, known exploit patterns). It is accurate for known attacks but cannot detect new ones.
Detectors can be host-based (HIDS, using audit logs and file changes on one machine) or network-based (NIDS, monitoring traffic). Honeypots are also used to attract and study intruders.
Four types of firewall
- Packet-filtering firewall (filters on IP addresses, ports, protocol)
- Stateful inspection firewall (tracks connection state)
- Application-level gateway (proxy firewall)
- Circuit-level gateway
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
Decrypt the message “GVPJ” using Hill cipher taking the key as {Row1 = 3 7, Row2 = 5 12}.
Answer
Key , ciphertext GVPJ.
, and , so
Check: (since ), and . Correct.
Ciphertext pairs: GV = (6, 21), PJ = (15, 9).
- GV: (D); (H).
- PJ: (N); (E).
Plaintext = DHNE
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
Describe the PKI trust model.
Answer
PKI trust model
In a Public Key Infrastructure, a trust model describes how users decide to trust the public key certificate of another party, that is, how certification authorities (CAs) are organized and how trust is passed along a chain of certificates. The main models are:
-
Hierarchical (rooted) model. A single root CA sits at the top and is trusted by everyone. It issues certificates to subordinate CAs, which in turn certify other CAs or end users. To verify a certificate, a user follows the chain up to the root, checking each signature. This is the model used by the web (X.509). If the root is compromised, the whole tree fails.
-
Single CA model. One CA issues all certificates; simple but a single point of failure, and not scalable.
-
Mesh (cross-certification) model. Several independent CAs trust each other by issuing cross-certificates. There is no single root; a user trusts their own CA and reaches others through certificate paths. It is flexible but path building is complex.
-
Bridge CA model. A bridge CA cross-certifies with the root of each separate hierarchy, so the hierarchies can interoperate without a full mesh.
-
Web of trust (PGP). There are no CAs. Each user signs the keys of others they know, and trusts a key if it is signed by introducers they trust. Trust is decentralized and personal.
Validation in all models checks the signatures along the path, validity dates, and revocation status (CRL or OCSP).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
Define authentication system. Illustrate the need of mutual authentication over one way authentication with an example.
Answer
Authentication system
An authentication system verifies the claimed identity of a user, device or message source before access is granted. Evidence can be something the user knows (password, PIN), has (smart card, token, OTP device) or is (fingerprint, face), and the system combines such factors with an authentication protocol and a store of credentials. The aim is to be sure that "the entity is who it claims to be".
One-way vs mutual authentication
In one-way authentication only one party (usually the client) proves its identity to the other (the server). The client cannot be sure the server is genuine.
In mutual authentication both parties authenticate each other, typically with a challenge-response exchange (nonces) using shared keys or certificates.
Need for mutual authentication, with an example
Consider an internet banking customer who logs in with username and password. With only one-way authentication, an attacker can set up a fake website (phishing, DNS spoofing or a man-in-the-middle). The customer, who has no means of checking the server, enters the password and the attacker captures it, then uses it on the real bank.
With mutual authentication (for example TLS with a server certificate checked by the browser in addition to the user's login, or Kerberos where the client sends an authenticator and the server returns encrypted with the session key), the client first verifies that the server holds a valid certificate or the right key, and only then sends credentials. The fake server fails this check, so man-in-the-middle and impersonation of the server are prevented. The same applies to a mobile phone and base station, or two servers talking to each other, where each must trust the other.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
Find the value of 7^2019 MOD 13 using Fermat’s Little theorem. Define Euler totient function with
an example.
Answer
using Fermat's little theorem
Since 13 is prime and , Fermat gives .
Divide the exponent: (as ).
, so
Euler totient function
is the number of positive integers less than that are relatively prime to (with ). For prime , ; for primes , ; in general .
Example: . The numbers coprime to 10 are 1, 3, 7, 9, so . Check: .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
List the properties of hash function. Discuss the first pass of MD4.
Answer
Properties of a hash function
A hash function maps a message of any length to a fixed-length digest . Required properties:
- Applicable to a block of data of any size.
- Produces a fixed-length output.
- Easy to compute for any (practical in hardware and software).
- Preimage resistance (one-way): given , it is computationally infeasible to find with .
- Second preimage resistance (weak collision resistance): given , it is infeasible to find with .
- Collision resistance (strong): it is infeasible to find any pair with .
- Pseudorandom output (avalanche effect: a one-bit change flips about half the output bits).
First pass (round) of MD4
MD4 processes the message in 512-bit blocks split into sixteen 32-bit words , and uses a 128-bit state of four registers (initial values 67452301, EFCDAB89, 98BADCFE, 10325476 in hex). Each block goes through three passes of 16 steps each.
In the first pass:
- The auxiliary function is (bitwise "if X then Y else Z").
- No additive constant is used.
- The words are taken in order .
- Each step is , and the roles of the registers rotate with each step.
- The left-rotation amounts repeat as for each group of four steps.
For example, the first four steps are and this pattern is repeated for , and . The result of the third pass is added to the input registers to give the chaining value.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
Differentiate between Symmetric and Asymmetric cipher. Encrypt the message “HELL” using
the key “FAIL” using Vernanm cipher.
Answer
Symmetric vs asymmetric cipher
| Symmetric | Asymmetric |
|---|---|
| One shared secret key for encryption and decryption | A key pair: public key and private key |
| Key must be exchanged secretly beforehand | Public key can be published; private key never shared |
| Fast, suitable for bulk data | Slow, computationally heavy, used for small data and key exchange |
| keys for users | keys for users |
| No non-repudiation | Supports digital signatures and non-repudiation |
| Examples: DES, AES, IDEA | Examples: RSA, ElGamal, ECC |
Vernam cipher: HELL with key FAIL
Each letter is encoded A=0, ..., Z=25 and the key letter is added mod 26 (equivalent to XOR in the binary form).
| H | E | L | L | |
|---|---|---|---|---|
| Plain | 7 | 4 | 11 | 11 |
| Key (FAIL) | 5 | 0 | 8 | 11 |
| Sum mod 26 | 12 | 4 | 19 | 22 |
| Cipher | M | E | T | W |
Ciphertext = METW
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
Divide 3x^2 + 4x +3 by 5x +6 over GF(7).
Answer
Divide by over .
In , because .
Step 1. Leading terms: . . Subtract: .
Step 2. . . Subtract: .
Check: . Correct.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2078 · 5 marks
Define SSL protocol. Mention the services provided by PGP.
Answer
SSL protocol
Secure Sockets Layer (SSL) is a protocol, developed by Netscape and standardised as TLS, that provides secure communication between a client and a server over TCP. It sits between the application layer and TCP and is used by HTTPS, secure mail and other protocols. It provides:
- Confidentiality, by symmetric encryption of the data with a session key negotiated during the handshake.
- Message integrity, by a MAC on each record.
- Authentication of the server (and optionally the client) with X.509 certificates.
It consists of the Record Protocol (fragmentation, compression, MAC, encryption) and the Handshake, Change Cipher Spec and Alert protocols.
Services provided by PGP (Pretty Good Privacy)
- Authentication (digital signature): the message hash (SHA) is signed with the sender's private key (RSA/DSS).
- Confidentiality: the message is encrypted with a one-time symmetric session key (CAST-128, IDEA, 3DES), and the session key is encrypted with the recipient's public key (RSA/ElGamal).
- Compression: the message is compressed (ZIP) after signing and before encryption, saving space and adding redundancy.
- E-mail compatibility: binary output is converted to ASCII using radix-64 (Base64) encoding.
- Segmentation and reassembly: large messages are split to meet e-mail size limits.
- Key management: public key rings and private key rings, and key signing via a web of trust.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 10 marks
Illustrate the concept of security policy and mechanism with an example. Differentiate between block cipher and stream cipher. Explain the process of key expansion in AES.
Answer
Security policy and mechanism
A security policy is a statement of what is and is not allowed in a system; it divides states into authorized (secure) and unauthorized (non-secure). A security mechanism is a method, tool or procedure that enforces the policy. The policy says what to protect and from whom; the mechanism says how.
Example: a hospital's policy says "only the treating doctor may read or change a patient's record; patients may read their own." Mechanisms that enforce it are login with password and OTP (authentication), role-based access control lists on the records database (authorization), encryption of stored and transmitted records, and audit logs. If any logged-in nurse could open every record, the mechanism would not meet the policy.
Block cipher vs stream cipher
| Block cipher | Stream cipher |
|---|---|
| Processes data in fixed-size blocks (64 or 128 bits) | Processes one bit or byte at a time |
| Uses substitution and permutation rounds; needs padding and a mode of operation | Key stream is generated and XORed with plaintext |
| Same key and plaintext block give same output in ECB; hides patterns in CBC/CTR | Key stream must never repeat |
| Slower, more complex | Faster, simple hardware, no padding |
| Examples: DES, AES, IDEA | Examples: RC4, A5/1, ChaCha20 |
Key expansion in AES
The key expansion routine turns the cipher key into a key schedule of round keys, each 128 bits (four 32-bit words). The number of round keys is : 11 for AES-128 (), 13 for AES-192, 15 for AES-256. For AES-128, 44 words are produced.
- The first four words are the 16 bytes of the cipher key itself (used in the initial AddRoundKey).
- For each later word ():
- If is not a multiple of 4: .
- If is a multiple of 4: , where does three things:
- RotWord: cyclic left shift of the word by one byte, .
- SubWord: each of the four bytes is replaced using the AES S-box.
- Round constant: the result is XORed with , where and in (01, 02, 04, 08, 10, 20, 40, 80, 1B, 36).
- For AES-256, an extra SubWord (without rotation or Rcon) is applied to when .
Words form the round key for round . The non-linear S-box and the round constants remove symmetry between rounds and make recovering the cipher key from a round key hard.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 10 marks
Describe the properties of hash functions. Discuss how hash value is generated using SHA-1 algorithm.
Answer
(Properties of hash functions)
A hash function maps a message of arbitrary length to a fixed-length output called the hash value or message digest. A cryptographic hash function should have:
- Variable input size: can be applied to a block of data of any size.
- Fixed output size: produces a fixed-length output (160 bits for SHA-1).
- Efficiency: computing is easy and fast for any , in hardware and software.
- Preimage resistance (one-way): for a given , it is computationally infeasible to find with .
- Second preimage resistance (weak collision resistance): for a given , it is infeasible to find with .
- Collision resistance (strong collision resistance): it is infeasible to find any pair , , with .
- Pseudorandomness: the output satisfies standard randomness tests, and a one-bit change in the input changes about half the output bits (avalanche effect).
(SHA-1 hash generation)
SHA-1 takes a message of length less than bits and produces a 160-bit digest. It processes the message in 512-bit blocks.
Step 1: Padding. Append a single bit 1, then enough 0 bits so that the length is . Padding is always added, even if the message already has that length.
Step 2: Append length. Append the original message length as a 64-bit big-endian integer. The padded message is now a multiple of 512 bits, split into blocks .
Step 3: Initialise the buffer. Five 32-bit registers are set to:
Step 4: Process each 512-bit block with the compression function of 80 steps (four rounds of 20 steps).
- Split the block into sixteen 32-bit words and expand to 80 words:
- For each step : (all additions are modulo ).
| Steps | ||
|---|---|---|
| 0-19 | 5A827999 | |
| 20-39 | 6ED9EBA1 | |
| 40-59 | 8F1BBCDC | |
| 60-79 | CA62C1D6 |
- After the 80 steps, add the results to the chaining values: , , and so on for (mod ). These become the input for the next block.
Step 5: Output. After the last block, the concatenation is the 160-bit message digest.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 10 marks
Show that Z 5is a field. John publishes the ElGamal public key (q, α, YA) =(101, 2, 14). Jane desired to send the secret message CSIT to John. Using the equivalence A = 0, B=1, … , Z=25, encrypt the message using John’s public key. Use a random number k = 4.
Answer
(Z is a field)
with addition and multiplication modulo 5. It is a field if it is a commutative ring with unity in which every non-zero element has a multiplicative inverse.
- Under addition mod 5: closure, associativity and commutativity hold; the identity is 0; the inverse of is (0 for 0). So it is an abelian group.
- Under multiplication mod 5: closure, associativity, commutativity hold; the identity is 1; and multiplication distributes over addition.
- Inverses of the non-zero elements:
Every non-zero element has an inverse, so is a field. This holds because 5 is prime, so for every .
(ElGamal encryption)
Public key: , , . Random .
Message CSIT with A=0, ..., Z=25: C = 2, S = 18, I = 8, T = 19.
One-time key: , and , so .
for each letter:
| Letter | ||
|---|---|---|
| C | 2 | 72 |
| S | 18 | |
| I | 8 | |
| T | 19 |
Ciphertext: .
(Decryption: and , using the same .)
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
Differentiate between Trojan horse and virus. Describe any two types of intruders.
Answer
(Trojan horse vs virus)
| Basis | Trojan horse | Virus |
|---|---|---|
| Definition | A program that appears useful but contains hidden malicious code | A program fragment that attaches itself to other programs or files |
| Replication | Does not replicate itself | Replicates by infecting other files |
| Spread | The user is tricked into running it | Spreads when the infected host program is executed or shared |
| Host needed | Stands alone as a disguised program | Needs a host file |
| Purpose | Backdoors, data theft, performs unauthorised actions | Corrupts or destroys data, consumes resources |
(Types of intruders)
- Masquerader: an outsider (not authorised to use the system) who penetrates the access controls, often by using a legitimate user's stolen account or password, to use that account.
- Misfeasor: a legitimate user who accesses data, programs or resources for which access is not authorised, or who misuses privileges.
- Clandestine user: an individual (insider or outsider) who seizes supervisory control of the system and uses it to evade auditing and access controls or to suppress audit collection.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
The message “IMOGUN” was encrypted with a Playfair cipher using keyword “GALOIS”. Decrypt the message.
Answer
Playfair key square for keyword GALOIS (I and J share a cell). Write the keyword without repeats, then the rest of the alphabet:
| G | A | L | O | I |
| S | B | C | D | E |
| F | H | K | M | N |
| P | Q | R | T | U |
| V | W | X | Y | Z |
Decryption rules: same row, take the letter to the left of each; same column, take the letter above each; otherwise take the letter in its own row and the column of the other letter.
Digraphs of IMOGUN: IM, OG, UN.
- IM: I is at row 1, column 5; M is at row 3, column 4. Different row and column (rectangle): I takes the letter in row 1, column 4 = O; M takes row 3, column 5 = N. So ON.
- OG: O and G are both in row 1, so move left: O gives L, and G wraps to the right end giving I. So LI.
- UN: U is at row 4, column 5; N is at row 3, column 5. Same column, move up. Column 5 reads I, E, N, U, Z, so the letter above U is N and the letter above N is E. So NE.
Plaintext: ON LI NE = ONLINE.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
How encryption is done using IDEA algorithm.
Answer
IDEA (International Data Encryption Algorithm) is a symmetric block cipher that encrypts a 64-bit block using a 128-bit key. It has 8 identical rounds followed by a final output transformation. It mixes three incompatible group operations on 16-bit words: bitwise XOR (), addition modulo (), and multiplication modulo (, where the all-zero word is treated as ).
Key schedule. 52 subkeys of 16 bits are produced: six per round ( for 8 rounds = 48) and four for the output transformation. The 128-bit key is split into the first eight 16-bit subkeys; the key is then rotated left by 25 bits and split again for the next eight, and so on.
One round. The 64-bit block is split into four 16-bit sub-blocks . With the six round subkeys :
- , then , then , and finally
- Outputs: , , ,
The two middle sub-blocks are swapped, so the next round's input is .
Output transformation (after round 8). The middle blocks are not swapped back (undoing the last swap), and using the last four subkeys. is the 64-bit ciphertext. Decryption uses the same structure with subkeys that are the multiplicative or additive inverses of the encryption subkeys in reverse order.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
Describe the services provided by Pretty Good Privacy protocol to secure email.
Answer
Pretty Good Privacy (PGP) provides confidentiality and authentication for email and file storage. It offers five services:
-
Authentication (digital signature). The sender computes a SHA-1 hash of the message, encrypts it with the sender's RSA/DSS private key, and attaches it to the message. The receiver decrypts it with the sender's public key and compares it with a hash of the received message. This proves the sender's identity and message integrity.
-
Confidentiality (encryption). The sender generates a random one-time session key, encrypts the message with it using a symmetric cipher (CAST-128, IDEA or 3DES), and encrypts the session key with the recipient's public key (RSA or ElGamal). Both are sent together. Only the recipient can recover the session key.
-
Compression. The message is compressed with ZIP after the signature is generated and before encryption. This saves transmission space and removes redundancy, which strengthens encryption.
-
E-mail compatibility. Encrypted output is binary, which many mail systems cannot carry. PGP converts the raw 8-bit binary stream to printable ASCII using Radix-64 (Base64) encoding, which expands the data by about 33%.
-
Segmentation and reassembly. Mail systems limit message length (often 50,000 octets). PGP breaks long messages into smaller segments and reassembles them at the receiver.
Both services can be combined: sign first, then compress, then encrypt, then Radix-64 convert.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
Define challenge response system. Why do we need Kerberos?
Answer
(Challenge-response system)
A challenge-response authentication system is one in which the verifier sends the claimant an unpredictable value (a challenge, usually a random nonce), and the claimant proves knowledge of a secret by returning a response computed from the challenge and the secret, without revealing the secret. For example:
- Verifier sends random to the user.
- The user returns , or , where is the shared secret.
- The verifier computes the same value and compares.
Because each challenge is fresh, an eavesdropper cannot reuse a recorded response (protection against replay attacks), and the password is never sent over the network.
(Why Kerberos is needed)
In an open distributed network, workstations are untrusted and users access many servers. Problems with the alternatives are:
- Sending the password to each server in the clear is insecure, and storing each user's password on every server is unmanageable.
- A workstation may impersonate another user, a user may spoof a workstation's network address, and eavesdroppers can replay captured messages.
Kerberos solves this with a trusted third party, based on symmetric encryption:
- Single sign-on: the user enters the password once, then gets a ticket-granting ticket (TGT) from the Authentication Server, and later gets service tickets from the Ticket Granting Server. The password never travels the network.
- Mutual authentication between client and server, using tickets and authenticators with timestamps against replay.
- Centralised key management: the Kerberos server shares a secret key with each user and each service, and issues session keys.
It therefore provides secure, scalable authentication for client-server systems.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
How direct digital signature different from arbitrated digital signature? How digital signature generation and verification is done using RSA.
Answer
(Direct vs arbitrated digital signature)
| Basis | Direct digital signature | Arbitrated digital signature |
|---|---|---|
| Parties | Only sender and receiver | Sender, receiver and a trusted arbiter |
| Process | Sender signs the message (or its hash) with his private key; receiver verifies with the sender's public key | Sender sends the signed message to the arbiter, who checks it and forwards it with a timestamp to the receiver |
| Trust | Receiver trusts the sender's key | Both parties trust the arbiter |
| Weakness | Sender can deny by claiming the private key was stolen or lost; depends on timestamps | Arbiter becomes a bottleneck and must be trusted fully |
| Strength | Simple | Solves repudiation and timing disputes |
(RSA signature generation and verification)
Key generation: choose primes ; ; ; choose with ; compute . Public key , private key .
Signing (by sender A):
- Compute the hash of the message: .
- Compute the signature using A's private key:
- Send and .
Verification (by receiver B):
- Compute the hash of the received message: .
- Recover with A's public key:
- If , the signature is valid (message is authentic and unaltered); otherwise it is rejected.
Only A knows , so only A could have produced .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
Why do we need discrete logarithm over normal logarithm? Find out whether 3 is primitive root of 7 or not.
Answer
(Need for discrete logarithms)
An ordinary logarithm is a continuous, monotonic function and is easy to compute (for example, by numerical methods) from the size of . In modular arithmetic, jumps around erratically, with no ordering or trend that reveals . Finding given (the discrete logarithm problem) has no known efficient algorithm for large , whereas computing is fast (square-and-multiply). This one-way property makes discrete logarithms the basis for Diffie-Hellman, ElGamal and DSA. Normal logarithms give no such hardness, so they cannot be used for security.
(Is 3 a primitive root of 7?)
A primitive root of 7 must generate all of as its powers, that is have order .
The powers are all distinct and cover every non-zero residue. Hence 3 is a primitive root of 7.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
Which one is more secure, monoalphabetic cipher or poly alphabetic cipher? Justify. Using rail fence cipher encrypt the text “LEARNING AND TEACHING ARE DIFFERENT” using 3 as rails.
Answer
(Monoalphabetic vs polyalphabetic)
A polyalphabetic cipher (for example Vigenere) is more secure than a monoalphabetic cipher (for example Caesar or general substitution).
- In a monoalphabetic cipher each plaintext letter always maps to the same ciphertext letter, so the letter-frequency distribution of the plaintext survives in the ciphertext. Frequency analysis (E, T, A being most common in English) breaks it easily, even though the key space () is large.
- A polyalphabetic cipher uses several substitution alphabets chosen by key letters, so the same plaintext letter is encrypted differently at different positions. This flattens the frequency distribution and hides the statistics, making cryptanalysis much harder (it requires finding the key length first, e.g. by Kasiski or index of coincidence).
(Rail fence, 3 rails)
Remove spaces: LEARNINGANDTEACHINGAREDIFFERENT (31 letters). Write in zigzag over 3 rails:
Rail 1 (positions 1, 5, 9, ...): L N A E I R F E Rail 2 (positions 2, 4, 6, ...): E R I G N T A H N A E I F R N Rail 3 (positions 3, 7, 11, ...): A N D C G D E T
Read row by row:
- Rail 1: LNAEIRFE
- Rail 2: ERIGNTAHNAEIFRN
- Rail 3: ANDCGDET
Ciphertext: LNAEIRFEERIGNTAHNAEIFRNANDCGDET
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2079 · 5 marks
What is the condition of for two integers, x and y, to be relatively prime? Find whether 61 is prime or not using Miller-Rabin algorithm.
Answer
(Relatively prime)
Two integers and are relatively prime (coprime) if their only positive common divisor is 1, that is
(Miller-Rabin test for 61)
Write with odd: , so , .
Choose a base (with ). Compute . If it is or , the test says "inconclusive (probably prime)". Otherwise square up to times looking for ; if never appears, is composite.
Base : : , so , . Not 1 or 60, so square: . We find at , so the test passes for .
Base (second check): : , so . This equals , so inconclusive (passes).
Both bases pass, and no witness for compositeness is found. Hence 61 is (probably) prime. Indeed 61 has no divisor up to (not divisible by 2, 3, 5, 7), so it is truly prime.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 10 marks
Define discrete logarithms. How key generation, encryption and decryption is done in RSA. In a RSA cryptosystem, given p=13 and q=7, determine private key, public key and perform encryption and decryption for the text M=”hi” using 0 to 25 for letters from a to z.
Answer
(Discrete logarithm)
For a prime with primitive root , every in can be written for a unique in . This is the discrete logarithm (index) of to base mod , written . Computing is easy, but finding from is computationally infeasible for large . This is the basis of Diffie-Hellman and ElGamal.
(RSA algorithm)
Key generation:
- Choose two large primes and .
- Compute and .
- Choose with and .
- Compute .
- Public key ; private key .
Encryption: for plaintext , ciphertext .
Decryption: .
This works because and Euler's theorem gives .
(Numerical problem, , )
Choose (). Find with : , so .
- Public key:
- Private key:
Message "hi" with a=0, ..., z=25: h = 7, i = 8.
Encryption:
- : , , , . So .
- : , , , . So .
Ciphertext: .
Decryption:
- . Use the Chinese remainder theorem: mod 7, so the result is ; mod 13, and (using ). The number congruent to and is . So = h.
- : since , . So = i.
Recovered plaintext: 7, 8 = "hi".
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 10 marks
Write down the encryption and decryption process at 2-DES and 3-DES. Explain the Fiestal cipher structure. Divide 5x^2 + 4x + 6 by 2x + 1 over GF(7).
Answer
(2-DES and 3-DES)
Double DES applies DES twice with two different keys (112-bit key):
Its effective strength is only about operations rather than because of the meet-in-the-middle attack: given a known pair , the attacker encrypts under all keys , decrypts under all keys , and looks for a matching middle value .
Triple DES (3DES, EDE mode) with two or three keys:
With two keys, . The middle step is decryption so that with it reduces to single DES (backward compatibility). It resists the meet-in-the-middle attack (effective key length 112 bits with two keys, 168 with three).
(Feistel cipher structure)
A Feistel network is the general design of many block ciphers (DES, Blowfish). The plaintext block is split into a left half and a right half . There are rounds, each using a subkey derived from the main key:
After the last round the halves are swapped, giving the ciphertext . Decryption uses the same structure with subkeys in reverse order . The function need not be invertible, which is the main advantage. Security depends on block size, key size, number of rounds, round function and key schedule. Confusion and diffusion are achieved through substitution and permutation in .
(Polynomial division over GF(7))
Divide by . In GF(7), (since ).
- First term: . Multiply: . Subtract: .
- Second term: . Multiply: . Subtract: .
Check: .
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 10 marks
What are the applications of hash functions? Discuss how SHA-1 algorithm generates hash value from a given message.
Answer
(Applications of hash functions)
- Message authentication / integrity: a digest sent with, or protected along with, a message detects any modification (basis of HMAC and MAC schemes).
- Digital signatures: the digest, not the whole message, is signed with a private key (RSA, DSA), which is faster and shorter.
- Password storage: systems store rather than the password.
- One-way password files and one-time passwords: for example S/KEY uses repeated hashing.
- Intrusion and virus detection: file hashes are stored and compared later to detect changes (tripwire-style tools).
- Pseudorandom number generation and key derivation: a hash is used to derive keys from seeds or passwords.
- Data structures and deduplication: checksums, hash tables, blockchain block linking, file identification.
(SHA-1 algorithm)
SHA-1 produces a 160-bit digest from a message shorter than bits, processing 512-bit blocks.
- Padding: append bit 1, then zeros until the length is .
- Length field: append the original length as a 64-bit value, so the total is a multiple of 512 bits.
- Initial values: five 32-bit registers
- Message schedule: each 512-bit block gives ; for
- Compression: set to . For each of 80 steps (4 rounds of 20):
| Round | ||
|---|---|---|
| 1 (0-19) | 5A827999 | |
| 2 (20-39) | 6ED9EBA1 | |
| 3 (40-59) | 8F1BBCDC | |
| 4 (60-79) | CA62C1D6 |
- Update chaining values: , , , , .
- Output: after the last block, is the digest.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
Show encryption and decryption of “csit” using hill cipher having key, k=
3 2 5 7
Answer
Key and inverse. With A=0, ..., Z=25,
since . The inverse is
Encryption. "csit" gives pairs and . Using on column vectors:
Ciphertext: QGKR.
Decryption. :
Recovered plaintext: csit.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
Give the formal definition of authentication system. Describe about one way and mutual authentication system.
Answer
(Formal definition of an authentication system)
An authentication system is a 5-tuple where:
- is the set of authentication information (for example passwords, keys) that entities use to prove identity,
- is the set of complementary information stored by the system to validate the authentication information,
- is the set of complementation functions, , that produce the complementary information from the authentication information,
- is the set of authentication functions, , that verify identity,
- is the set of selection functions that let an entity create or alter and .
A user presents ; the system computes and checks that is true for the stored . For example, with a hashed password file, is the hash function and compares the hashes.
(One-way authentication)
Only one party authenticates itself to the other, for example a client proves its identity to a server (password login). The server is not verified. It is simple but vulnerable to a fake server. In a protocol, the claimant sends identity plus proof (a password, or a response to a nonce/timestamp), and the verifier checks it. Typical use: email systems and one-way authentication of A to B with a timestamp or a nonce.
(Mutual authentication)
Both parties verify each other's identity before communicating, for example client and server, using challenge-response with nonces:
- A B: , nonce
- B A: (B proves it knows the key and challenges A)
- A B: (A proves its identity)
It defends against impersonation of either side and against replay attacks. Kerberos and SSL/TLS use mutual authentication.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
List the stage of certificate life cycle. What are the types of firewalls?
Answer
(Stages of the certificate life cycle)
- Registration / initialisation: the subject proves identity to the registration authority and key pair generation takes place.
- Certification (issuance): the CA verifies the request, signs and issues the certificate binding the public key to the identity.
- Distribution / key pair recovery and storage: the certificate is published in a directory and delivered to the subscriber.
- Use / validation: the certificate is used for encryption, signing and authentication; relying parties validate the signature, validity period and revocation status.
- Revocation: the certificate is withdrawn before expiry if the key is compromised or the details change. It is listed on a CRL or checked via OCSP.
- Renewal / update: a new certificate is issued before the old one expires.
- Expiration / destruction: after the validity ends, the certificate is archived and the keys destroyed.
(Types of firewalls)
- Packet-filtering firewall: works at the network layer; accepts or drops each packet by rules on source/destination IP, port and protocol. Fast, but has no knowledge of connection state or application data.
- Stateful inspection firewall: keeps a table of active connections and allows packets that belong to a valid connection (for example TCP handshake state). More secure than simple filters.
- Application-level gateway (proxy firewall): works at the application layer; acts as a relay for specific services (HTTP, FTP), inspecting the content. Very secure but slower.
- Circuit-level gateway: works at the transport layer; relays TCP connections after checking the handshake, without examining the data (SOCKS).
- Next-generation firewall: combines the above with deep packet inspection, intrusion prevention and application awareness.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
What is malicious logic? How zombies are different from trojan horses?
Answer
(Malicious logic)
Malicious logic is hardware, software or firmware intentionally inserted into a system to perform an unauthorised process that violates the system's security policy and harms confidentiality, integrity or availability. Examples are Trojan horses, viruses, worms, logic bombs, zombies, rabbits and backdoors.
(Zombies vs Trojan horses)
| Basis | Zombie | Trojan horse |
|---|---|---|
| Meaning | A compromised computer, secretly controlled remotely by an attacker, usually as part of a botnet | A program that looks useful but carries hidden malicious code |
| Purpose | Launches attacks such as DDoS, sends spam, from an infected host on the attacker's command | Performs unauthorised actions on the victim's system itself, such as stealing data or opening a backdoor |
| Control | Waits for commands from a command-and-control server | Acts on its own logic, or opens access for the attacker |
| Origin | A zombie is often the result of a Trojan, virus or worm infection | One of the means of creating a zombie |
| Visibility | The owner usually notices only slow performance | Is disguised as legitimate software to trick the user |
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
How Miller Rabin test is used for primality testing? Show whether the number 561 passes the test.
Answer
(Miller-Rabin test)
Miller-Rabin is a probabilistic primality test. For odd :
- Write with odd.
- Choose a random base , .
- Compute . If or , return "inconclusive" (possibly prime).
- Otherwise square repeatedly: for compute . If , return "inconclusive".
- If is never reached, is definitely composite and is a witness.
If is prime, the test always returns inconclusive. If is composite, a random passes with probability at most , so repeating times reduces the error to .
(n = 561)
is a Carmichael number (it passes the Fermat test for every base coprime to it). Write , so , .
Take :
- (neither 1 nor 560)
The value never occurred in the sequence (for the loop looks at and none equals 560, and ). Moreover, 67 is a non-trivial square root of 1 modulo 561 ( but ), which is impossible for a prime.
Hence 561 does not pass the Miller-Rabin test; it is declared composite, with as a witness. This shows Miller-Rabin catches Carmichael numbers that fool the Fermat test.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
Show that the set of integers is Ring under addition and multiplication.
Answer
A ring is a set with two operations satisfying:
- is an abelian group,
- is closed and associative,
- distributes over .
For the set of integers :
Addition
- Closure: for all .
- Associativity: .
- Identity: and .
- Inverse: for each , and .
- Commutativity: .
Hence is an abelian group.
Multiplication 6. Closure: . 7. Associativity: .
Distributivity 8. and .
All properties hold, so is a ring. In addition, multiplication is commutative () and has identity 1, so it is a commutative ring with unity, and has no zero divisors (an integral domain). It is not a field because, for example, 2 has no integer multiplicative inverse.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
How substitution ciphers are different from transposition ciphers? Given a message M=”CSIT PROGRAM IS A HOT CAKE”, encrypt M using Rail Fence cipher with rail size 3.
Answer
(Substitution vs transposition ciphers)
| Basis | Substitution cipher | Transposition cipher |
|---|---|---|
| Principle | Each plaintext letter (or group) is replaced by another symbol | The positions of letters are rearranged; the letters themselves are unchanged |
| Letters | Identity changes, order is kept | Identity is kept, order changes |
| Frequency | Letter frequencies are altered (hidden in polyalphabetic types) | Letter frequencies are exactly the same as in the plaintext |
| Examples | Caesar, Playfair, Hill, Vigenere | Rail fence, columnar transposition |
| Property | Provides confusion | Provides diffusion |
(Rail fence, 3 rails)
Remove spaces: CSITPROGRAMISAHOTCAKE (21 letters). Zigzag on 3 rails:
- Rail 1: C P R S T E
- Rail 2: S T R G A I A O C K
- Rail 3: I O M H A
Reading the rails in order gives:
Ciphertext: CPRSTESTRGAIAOCKIOMHA
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
Describe about IPSec. List the five services of PGP.
Answer
(IPSec)
IP Security (IPSec) is a suite of protocols that secures communication at the network (IP) layer, so all upper-layer applications (TCP, UDP, and so on) are protected transparently. It is used for VPNs and secure branch-office connectivity. Its components are:
- Authentication Header (AH): provides data integrity, origin authentication and anti-replay protection, but no encryption.
- Encapsulating Security Payload (ESP): provides confidentiality (encryption) and optionally integrity and authentication.
- Internet Key Exchange (IKE) and Security Associations (SA): an SA is a one-way logical relationship defining the algorithms and keys used; IKE negotiates and manages keys automatically.
It works in two modes: transport mode protects only the payload of the IP packet (host to host), and tunnel mode encapsulates and protects the entire original IP packet inside a new IP packet (gateway to gateway, used for VPNs).
(Five services of PGP)
- Authentication (digital signature using SHA-1 and RSA/DSS)
- Confidentiality (symmetric encryption with a session key protected by public-key encryption)
- Compression (ZIP)
- E-mail compatibility (Radix-64 conversion)
- Segmentation and reassembly
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2080 · 5 marks
How does meet in middle attack work in Diffie Helman key exchange protocol? Explain.
Answer
Diffie-Hellman key exchange. Public parameters are a prime and a primitive root . A chooses a secret and sends . B chooses and sends . Both compute the shared key . The protocol is secure against passive eavesdroppers because of the discrete logarithm problem, but it has no authentication of the parties.
The man-in-the-middle attack. (This is the attack usually meant by "meet in middle" for Diffie-Hellman.) The attacker Darth intercepts the exchanged values:
- Darth generates two secrets and computes , .
- A sends to B; Darth intercepts it and sends to B. Darth computes .
- B sends to A; Darth intercepts it and sends to A. Darth computes .
- A computes , B computes .
Now A shares key with Darth and B shares key with Darth, while each believes they share a key with each other. Darth can decrypt each message from A with , read or modify it, and re-encrypt it with for B (and the reverse), without either party noticing.
Countermeasure: authenticate the exchanged values with digital signatures, certificates or a pre-shared key (for example, authenticated Diffie-Hellman as in station-to-station protocol or IKE).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 10 marks
Let us consider the 4 bits key set as {1100, 1010, 0000, 1111, 0101, 1001} and input text as {1011, 1110, 1011, 1000}. Now trace the first full round operation of IDEA algorithm.
Answer
Here IDEA is scaled down to 4-bit words. The operations are: XOR (); addition modulo (); multiplication modulo (), where the all-zero word 0000 is treated as 16 and a result of 16 is written back as 0000.
Subkeys of the round
, , , , , .
Input
, , , .
Round trace
Round outputs
After swapping the two middle blocks, the output of the first round (input to round 2) is
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 10 marks
What is Message Authentication Code? List the operation of computing digest value in different passes of MD4. Describe about Needhom-Schroeder protocol.
Answer
(Message Authentication Code)
A Message Authentication Code (MAC) is a short fixed-size tag computed from a message and a shared secret key, . The sender appends it to the message. The receiver, who has the same key, recomputes it and compares. A match proves the message was not altered (integrity) and came from someone holding the key (authentication). Unlike a plain hash, an attacker without the key cannot forge a valid MAC. Examples: CBC-MAC (DAA) and HMAC.
(MD4 digest computation)
MD4 produces a 128-bit digest from 512-bit blocks. The message is padded (1 followed by 0s to , then a 64-bit length). The chaining variables (32 bits each) are initialised, and each block is processed in three passes of 16 steps each (48 steps). In each step one of the registers is updated as
| Pass | Function | Constant | Order of message words | Shifts |
|---|---|---|---|---|
| 1 | 0 | 3, 7, 11, 19 (repeating) | ||
| 2 | 5A827999 | 3, 5, 9, 13 | ||
| 3 | 6ED9EBA1 | 3, 9, 11, 15 |
After the three passes, the results are added to the values at the start of the block (, and so on). The final is the digest.
(Needham-Schroeder protocol)
The Needham-Schroeder protocol (symmetric-key version) lets two parties A and B obtain a fresh shared session key through a trusted Key Distribution Centre (KDC). A shares the master key with the KDC, and B shares .
- A KDC: (request for a session key, with nonce )
- KDC A:
- A B: (A forwards the ticket)
- B A: (B challenges A with nonce )
- A B: (A answers with a function of , such as )
The nonce ensures that the reply in step 2 is fresh and matches the request; steps 4-5 confirm that both hold . A known weakness is that step 3 can be replayed with a compromised old session key (it carries no timestamp), which Kerberos fixes by adding timestamps and lifetimes.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 10 marks
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.
Answer
Need for the discrete logarithm
Modular exponentiation is easy to compute (square-and-multiply needs about multiplications), but the reverse problem, finding from , and , has no known efficient algorithm when is large (hundreds of digits). This asymmetry is a one-way function, and it is the reason we need the discrete logarithm: the security of Diffie-Hellman key exchange, ElGamal encryption and DSA rests on the difficulty of computing it.
For a prime and a primitive root of , the powers are all distinct mod and produce every value . So for any there is a unique exponent with , called the discrete logarithm , i.e. .
Example: for , : . Given , . For tiny we find it by trial, for a 2048-bit this is infeasible.
Diffie-Hellman with
A primitive root of 13 is . Its powers mod 13 are:
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | 4 | 8 | 3 | 6 | 12 | 11 | 9 | 5 | 10 | 7 | 1 |
All values 1 to 12 appear, so 2 is a primitive root.
Private key of A. Public key . From the table, .
Private key of B. Public key . From the table, .
Shared secret key.
, , so .
Check from B's side:
Both give . (Using the shared key is .)
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
Show the encryption of plain text “ALGORITHM” using the key “PSEUDOCODE” using playfair cipher.
Answer
Playfair cipher: plaintext ALGORITHM, key PSEUDOCODE
Step 1: 5x5 key matrix. Write the key without repeated letters: P S E U D O C A (the second D, O, E are dropped), then the remaining letters of the alphabet in order, with I and J sharing a cell.
Key letters: P, S, E, U, D, O, C. Remaining: A, B, F, G, H, I/J, K, L, M, N, Q, R, T, V, W, X, Y, Z.
| P | S | E | U | D |
| O | C | A | B | F |
| G | H | I/J | K | L |
| M | N | Q | R | T |
| V | W | X | Y | Z |
Step 2: digraphs. Plaintext ALGORITHM has no doubled letters in a pair: AL GO RI TH M. The odd last letter M is padded with X.
AL | GO | RI | TH | MX
Step 3: encrypt each pair.
Rule: same row, take the letter to the right; same column, take the letter below; otherwise take the letter in own row and the column of the other letter (rectangle).
- AL: A (row 2, col 3), L (row 3, col 5). Rectangle, so A takes col 5 of row 2 = F, L takes col 3 of row 3 = I. Result FI.
- GO: G (row 3, col 1), O (row 2, col 1). Same column, so move down: G becomes M, O becomes G. Result MG.
- RI: R (row 4, col 4), I (row 3, col 3). Rectangle: R takes col 3 of row 4 = Q, I takes col 4 of row 3 = K. Result QK.
- TH: T (row 4, col 5), H (row 3, col 2). Rectangle: T takes col 2 of row 4 = N, H takes col 5 of row 3 = L. Result NL.
- MX: M (row 4, col 1), X (row 5, col 3). Rectangle: M takes col 3 of row 4 = Q, X takes col 1 of row 5 = V. Result QV.
Ciphertext: FI MG QK NL QV (FIMGQKNLQV).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
Discuss the working mechanism of kerberos protocol.
Answer
Kerberos
Kerberos is a trusted third-party, ticket-based network authentication protocol based on symmetric-key cryptography (Needham-Schroeder). It lets a client prove its identity to many servers over an insecure network without sending the password, and gives single sign-on. Version 4 uses DES; version 5 uses AES and other ciphers.
Entities: Client (C), Authentication Server (AS), Ticket Granting Server (TGS), and the application Server (V). The AS and TGS together form the Key Distribution Center (KDC), which holds the secret keys of all principals.
Working (version 4 style)
- C to AS: the client sends its identity , the TGS identity and a timestamp .
- AS to C: the AS looks up the client's key (derived from the password) and replies with where . Only the real user can decrypt this, using the password-derived key, and obtains the session key and the ticket-granting ticket (TGT).
- C to TGS: to access server V the client sends , and an authenticator . The authenticator proves the sender holds the session key and is fresh.
- TGS to C: the TGS decrypts the ticket and authenticator, checks them, and returns , where .
- C to V: the client sends and a new authenticator .
- V to C (mutual authentication): the server replies , proving it also knows .
After step 6, C and V share the session key for secure communication.
Advantages: the password never crosses the network; the TGT lets the user authenticate once per session; timestamps and lifetimes resist replay. Limitations: the KDC is a single point of failure and the clocks of all parties must be loosely synchronised.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
What is the use of firewall? How circuit level gateway differs from stateful inspection firewall?
Answer
Use of a firewall
A firewall is a hardware or software barrier placed between a trusted internal network and an untrusted external network (the Internet). All traffic in both directions must pass through it, and only traffic permitted by the local security policy is allowed. Its uses are:
- To filter incoming and outgoing packets by address, port, protocol or content, blocking unauthorised access and many attacks (port scans, IP spoofing, DoS).
- To provide a single choke point where security monitoring, logging and auditing are applied.
- To hide the internal network structure (NAT) and to provide VPN and proxy services.
- To enforce the organisation's security policy, such as blocking certain services or sites.
Circuit-level gateway versus stateful inspection firewall
| Basis | Circuit-level gateway | Stateful inspection firewall |
|---|---|---|
| OSI layer | Session layer (between transport and application). | Network and transport layers, with some application-layer awareness. |
| Operation | Acts as a relay: sets up two TCP connections (client to gateway, gateway to server) and copies bytes between them without examining the data. | Examines every packet and keeps a state table of active connections (addresses, ports, sequence numbers, flags). |
| Decision basis | Whether a TCP handshake is valid and the session is allowed; once the circuit is set up, all data is relayed. | Whether the packet belongs to a known, legitimate connection state, plus rule sets. Packets with no matching state are dropped. |
| Payload checking | None; contents are not inspected. | Can check packet header and, in advanced products, parts of the payload. |
| Security / overhead | Hides internal hosts, but cannot detect malicious data inside an allowed session. Low overhead. | Stronger security, since it detects out-of-state or spoofed packets, but needs more memory and processing. |
| Example | SOCKS proxy. | Check Point FireWall-1, modern iptables with connection tracking. |
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
What is intrusion ? Explain any two types of intrusion detection system.
Answer
Intrusion
An intrusion is an unauthorised attempt, successful or not, to access, misuse or damage a system or network, violating its confidentiality, integrity or availability. Examples are password guessing, privilege escalation by a legitimate user, malware infection and exploiting software vulnerabilities. An Intrusion Detection System (IDS) monitors system or network activity, detects such events and raises alerts (an IPS also blocks them).
Types of IDS
1. Network-based IDS (NIDS). Sensors are placed at key points of the network (behind the firewall, on a switch mirror port) and capture and analyse packets passing by.
- Detects port scans, DoS floods, malformed packets and known attack signatures in traffic.
- One sensor covers many hosts and is invisible to attackers, so it is easy to deploy.
- Weaknesses: cannot read encrypted traffic, may drop packets on a fast network, and cannot see what happens inside a host.
- Example: Snort.
2. Host-based IDS (HIDS). Software installed on an individual host monitors system logs, file integrity (checksums of critical files), system calls, running processes and login activity.
- Detects local attacks such as unauthorised file changes, rootkits, privilege abuse and attacks that arrive over encrypted channels.
- Gives detailed information about the affected host.
- Weaknesses: must be installed and maintained on every host, uses host resources, and is blinded if the host itself is compromised.
- Example: Tripwire, OSSEC.
(By detection method, an IDS is also classed as signature-based, which matches known attack patterns and is accurate for known attacks but misses new ones, and anomaly-based, which flags deviation from a learned normal profile and can find new attacks but gives more false alarms.)
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
Find the multiplicative inverse of polynomial {95} using extended euclidean Algorithm.
Answer
Multiplicative inverse of {95} in
{95} is a hexadecimal byte: , i.e. the polynomial The field uses the AES irreducible polynomial ({11B}). We find with the extended Euclidean algorithm: and (addition is XOR), starting with and .
Divisions
- : quotient , remainder (since ). .
- : quotient , remainder . Check: ; added to gives . .
- : gives quotient , remainder .
The remainder is 1, so and the inverse is :
Verification: :
(the terms cancel in pairs).
Reducing with : , , , ; , , . Sum: Hence the product is 1.
Answer: {95} = {8A}.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
What is DoS attack ? Discuss about PKI trust model.
Answer
DoS attack
A Denial of Service (DoS) attack is an attempt to make a computer, service or network unavailable to its legitimate users by exhausting its resources (bandwidth, CPU, memory, connection table) or by crashing it with malformed input. When the attack is launched from many compromised machines (a botnet) at once, it is a Distributed DoS (DDoS). It attacks the availability goal of security.
Common forms:
- SYN flood: many TCP SYN packets with spoofed source addresses fill the server's half-open connection queue.
- ICMP/ping flood and smurf attack: flooding the target with ICMP echo traffic, directly or through broadcast amplification.
- UDP flood and DNS/NTP amplification: small spoofed requests produce large replies sent to the victim.
- Ping of death / teardrop: malformed or oversized packets crash the protocol stack.
Countermeasures are ingress/egress filtering, SYN cookies, rate limiting, firewalls/IPS, and traffic scrubbing or CDN services.
PKI trust models
A Public Key Infrastructure (PKI) binds public keys to identities through certificates signed by Certification Authorities (CAs). A trust model defines how a user decides to trust a certificate issued by a CA he does not know directly.
- Hierarchical (rooted) model. CAs form a tree. A single root CA, trusted by everyone, certifies subordinate CAs, which certify lower CAs and end users. A certificate is validated by following the chain up to the root. Used in the web (X.509 root stores). Simple, but compromise of the root breaks everything.
- Bridge (cross-certification / mesh) model. Independent CAs or hierarchies issue certificates to each other, often through a bridge CA, so that users of different PKIs can validate each other. Flexible, but path discovery is more complex.
- Web of trust (PGP). There are no CAs. Each user signs the keys of people he knows personally and decides how much to trust other signers. A key is trusted if enough trusted people have signed it. Decentralised, but hard to scale.
- Single-CA / trust list models. One CA for a closed organisation, or a browser-style list of trusted CAs.
In every model the certificate path is checked for valid signatures, validity period and revocation status (CRL or OCSP).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
Using Vignere cipher with key = “worlds”, encrypt the plain text “hello everyone”.
Answer
Vigenere cipher: key "worlds", plaintext "hello everyone"
Encryption: , with A=0, B=1, ..., Z=25. Spaces are ignored. The plaintext letters are HELLOEVERYONE (13 letters). The key repeats: W O R L D S W O R L D S W (values 22, 14, 17, 11, 3, 18, 22, 14, 17, 11, 3, 18, 22).
| Plain | H | E | L | L | O | E | V | E | R | Y | O | N | E |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 7 | 4 | 11 | 11 | 14 | 4 | 21 | 4 | 17 | 24 | 14 | 13 | 4 | |
| Key | W | O | R | L | D | S | W | O | R | L | D | S | W |
| 22 | 14 | 17 | 11 | 3 | 18 | 22 | 14 | 17 | 11 | 3 | 18 | 22 | |
| 29 | 18 | 28 | 22 | 17 | 22 | 43 | 18 | 34 | 35 | 17 | 31 | 26 | |
| mod 26 | 3 | 18 | 2 | 22 | 17 | 22 | 17 | 18 | 8 | 9 | 17 | 5 | 0 |
| Cipher | D | S | C | W | R | W | R | S | I | J | R | F | A |
Ciphertext: DSCWRWRSIJRFA (DSCWR WRSIJRFA when grouped like the plaintext).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
Describe the different modes of block cipher.
Answer
Modes of block cipher operation
A block cipher encrypts fixed-size blocks (64 bits for DES, 128 bits for AES). To encrypt longer messages securely, NIST defines modes of operation. Let be plaintext blocks, ciphertext blocks and the block encryption.
1. Electronic Codebook (ECB). Each block is encrypted independently: Simple and parallelisable, and errors do not propagate. But identical plaintext blocks give identical ciphertext blocks, so patterns leak; it is suitable only for short data such as keys.
2. Cipher Block Chaining (CBC). Each plaintext block is XORed with the previous ciphertext block before encryption: Identical plaintext blocks give different ciphertext. Encryption is sequential; an error in a ciphertext block garbles that block and flips a bit in the next one. A random IV is needed.
3. Cipher Feedback (CFB). The block cipher is used as a stream cipher on -bit segments. The shift register (initially the IV) is encrypted and its leftmost bits are XORed with the plaintext segment: Self-synchronising; only the encryption function is used (for both directions). An error affects the next block-size worth of data.
4. Output Feedback (OFB). Like CFB, but the feedback is the cipher output and not the ciphertext: The keystream does not depend on the plaintext and can be precomputed; a bit error in ciphertext causes only a single bit error in the plaintext. The IV must never be reused with the same key.
5. Counter (CTR). A counter (nonce plus a block number) is encrypted and XORed with plaintext: Fully parallel in both encryption and decryption, with random access to any block, and no padding required.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2081 · 5 marks
Write short notes on (any two)
- Totient value of any positive integer.
- Properties of hash function.
- Virus or Worms.
Answer
1. Totient value of a positive integer
Euler's totient function is the number of positive integers less than that are relatively prime to (that is, , ), with .
Properties:
- If is prime, .
- For a prime power, .
- It is multiplicative: if then . Hence for ,
- In particular, for primes : .
Example: : the numbers coprime to 12 below 12 are 1, 5, 7, 11, so . By the formula, .
Euler's theorem: for . This is the basis of RSA, where is used to compute the private key .
2. Properties of a hash function
A hash function maps a message of arbitrary length to a fixed-length digest . A cryptographic hash function should satisfy:
- Variable input size: can be applied to a block of any size.
- Fixed output size: it produces a fixed-length output.
- Efficiency: is easy to compute for any .
- Preimage resistance (one-way): given , it is computationally infeasible to find with .
- Second-preimage resistance (weak collision resistance): given , it is infeasible to find with .
- Collision resistance (strong): it is infeasible to find any pair with .
- Avalanche effect / pseudorandomness: a one-bit change in the input changes about half the output bits.
Uses: message integrity, digital signatures, password storage and MACs (HMAC).
3. Virus and worms
A virus is malicious code that attaches itself to a host program or file and replicates when the infected program is executed by the user. Its phases are dormant, propagation, triggering and execution. Types are parasitic, boot-sector, memory-resident, macro and polymorphic/metamorphic viruses. It needs human action (running the host file) to spread.
A worm is a standalone self-replicating program that spreads by itself over networks, exploiting vulnerabilities in services, e-mail or shared drives, without needing a host program or user action. It searches for new targets, transfers a copy and executes it there. Examples: Morris worm (1988), Code Red, Slammer. Worms mainly consume bandwidth and resources and may carry a payload such as a backdoor.
| Virus | Worm | |
|---|---|---|
| Host program | Needed | Not needed |
| Spread | By user running infected file | Automatically via network |
| Speed | Slower | Very fast |
Defence: antivirus software, patching, firewalls and user awareness.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 10 marks
Describe the Fiestel Cipher structure. Given the key {2B, 7E, 15, 16, 28, AE, D2, A6, AB, F7, 97, 66, 01, 02, 03, 04}, compute the first 4 byte of next key after first iteration, using the following S-Box in AES.
0 1 2 3 4 5 6 7 8 9 A B C D E F 0 63 7C 77 7B F2 6B 6F C5 30 01 67 2B FE D7 AB 76
Answer
Feistel cipher structure
The Feistel structure (used in DES, Blowfish, Camellia) builds a strong block cipher from a repeated simple round. It was proposed by Horst Feistel, following Shannon's ideas of confusion (substitution) and diffusion (permutation).
- The plaintext block of bits is split into a left half and a right half .
- There are rounds. In round a subkey , derived from the main key by a key schedule, is used.
- Each round performs: where is the round function (substitution and permutation, not necessarily invertible).
- After the last round the halves are swapped, giving the ciphertext .
- Decryption uses the same structure with the subkeys in reverse order . Because , never needs to be inverted.
Design parameters: block size, key size, number of rounds, subkey generation and the round function . Larger sizes give more security but lower speed.
First four bytes of the next key (AES key expansion, first iteration)
The 128-bit key is 16 bytes, divided into four words:
, , , .
The next round key starts with , where does three things.
- RotWord on (one-byte left rotation): .
- SubWord with the S-box (row = high nibble 0, column = low nibble):
- 02 gives 77
- 03 gives 7B
- 04 gives F2
- 01 gives 7C
Result . 3. XOR with the round constant : . Result .
Now :
| Byte | XOR | ||
|---|---|---|---|
| 1 | 2B = 0010 1011 | 76 = 0111 0110 | 0101 1101 = 5D |
| 2 | 7E = 0111 1110 | 7B = 0111 1011 | 0000 0101 = 05 |
| 3 | 15 = 0001 0101 | F2 = 1111 0010 | 1110 0111 = E7 |
| 4 | 16 = 0001 0110 | 7C = 0111 1100 | 0110 1010 = 6A |
The first four bytes of the next key are {5D, 05, E7, 6A}.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 10 marks
Illustrate the man in middle attack in Diffie – Hellman key exchange protocol. Assume the prime number be 19 and 10 as its primitive root. Select 5 as private key and 4 as random integer. Find the cipher text of M = 2 using Elgamal crypto system.
Answer
Man-in-the-middle attack on Diffie-Hellman
Diffie-Hellman key exchange does not authenticate the parties, so an active attacker Darth who can intercept and modify messages can set up separate keys with each of them.
Public parameters: prime and primitive root .
- Alice chooses private and computes . Bob chooses and computes .
- Darth generates his own private value and .
- Alice sends ; Darth intercepts it and sends to Bob. Bob sends ; Darth intercepts it and sends to Alice.
- Alice computes . Darth computes the same value .
- Bob computes . Darth computes .
Alice now shares key 5 with Darth and Bob shares key 9 with Darth, while each believes they share a key with each other. Darth decrypts every message from Alice with , reads or alters it, re-encrypts it with and forwards it to Bob (and vice versa). Neither party notices. Prevention: authenticate the exchanged values with digital signatures or certificates (station-to-station protocol).
ElGamal encryption
Given , , private key , random integer , message .
Public key: . (, , .)
One-time key: .
Ciphertext:
The ciphertext is .
Check by decryption: (as ). since . . Correct.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 10 marks
List the properties of hash function. Describe the algorithm for SHA-1.
Answer
Properties of a hash function
A hash function maps a message of any length to a fixed-length digest. For cryptographic use it should have:
- Variable-length input and fixed-length output.
- Efficient computation of for any in hardware and software.
- Preimage resistance (one-way): given , infeasible to find with .
- Second-preimage resistance: given , infeasible to find with .
- Collision resistance: infeasible to find any with .
- Avalanche effect: a small change in the input changes the digest unpredictably.
SHA-1 algorithm
SHA-1 (Secure Hash Algorithm, NIST 1995) takes a message of length less than bits, processes it in 512-bit blocks and produces a 160-bit digest.
Step 1: Padding. Append a single bit 1, then 0 bits until the length is . The padding is always added, even if the message already has that length.
Step 2: Append length. Append the original message length as a 64-bit big-endian integer. The message is now a multiple of 512 bits.
Step 3: Initialise the buffer. Five 32-bit registers (the hash state ) are set to
- = 67452301
- = EFCDAB89
- = 98BADCFE
- = 10325476
- = C3D2E1F0
Step 4: Process each 512-bit block.
(a) Divide the block into sixteen 32-bit words and expand to 80 words:
(b) Set to the current .
(c) Run 80 steps (), in four rounds of 20 steps:
| Steps | ||
|---|---|---|
| 0 to 19 | 5A827999 | |
| 20 to 39 | 6ED9EBA1 | |
| 40 to 59 | 8F1BBCDC | |
| 60 to 79 | CA62C1D6 |
(d) Add the result to the chaining value (mod ): .
Step 5: Output. After the last block, the digest is the concatenation (160 bits).
SHA-1 is no longer considered collision-resistant (a practical collision was shown in 2017), so SHA-2 or SHA-3 is preferred.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
Describe any three types of malicious logic.
Answer
Malicious logic
Malicious logic (malware) is any program or code inserted into a system to harm its confidentiality, integrity or availability. Three common types follow.
1. Virus. A piece of code that attaches itself to an executable file, boot sector or document macro and spreads when the infected host is run or opened. It passes through dormant, propagation, triggering and execution phases. It copies itself into other files and may delete data, corrupt files or display messages. It needs user action to spread. Variants are parasitic, memory-resident, boot-sector, macro, polymorphic and metamorphic viruses.
2. Worm. A self-contained program that replicates and spreads across networks on its own, using vulnerabilities in network services, e-mail or removable media. It needs no host file and no user action. It causes network congestion and can install backdoors or carry a payload. Examples: Morris worm, Code Red, Blaster.
3. Trojan horse. A program that appears useful or harmless (a game, utility, cracked software) but carries a hidden harmful function, such as stealing passwords, opening a backdoor or deleting files. It does not replicate by itself; users install it voluntarily.
Other types are logic bomb (code that triggers on a condition such as a date or a deleted employee record), backdoor/trapdoor (secret entry point bypassing authentication), spyware, ransomware, rootkit and botnet agents.
Countermeasures: antivirus and anti-malware, regular patching, firewalls, least privilege, backups and safe user behaviour.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
Given the key “HELLOWORLD”, encrypt the plaintext “TURINGTEST” using Play fair cipher.
Answer
Playfair cipher: key HELLOWORLD, plaintext TURINGTEST
Step 1: Key matrix. Remove repeated letters from HELLOWORLD to get H E L O W R D. Then add the remaining alphabet letters in order (I and J share a cell).
| H | E | L | O | W |
| R | D | A | B | C |
| F | G | I/J | K | M |
| N | P | Q | S | T |
| U | V | X | Y | Z |
Step 2: Digraphs. TURINGTEST has no repeated letters inside a pair: TU RI NG TE ST (10 letters, 5 pairs).
Step 3: Encryption. (Same row: take the letter on the right; same column: take the letter below; otherwise swap columns.)
- TU: T (row 4, col 5), U (row 5, col 1). Rectangle: T takes col 1 of row 4 = N, U takes col 5 of row 5 = Z. Result NZ.
- RI: R (row 2, col 1), I (row 3, col 3). Rectangle: R takes col 3 of row 2 = A, I takes col 1 of row 3 = F. Result AF.
- NG: N (row 4, col 1), G (row 3, col 2). Rectangle: N takes col 2 of row 4 = P, G takes col 1 of row 3 = F. Result PF.
- TE: T (row 4, col 5), E (row 1, col 2). Rectangle: T takes col 2 of row 4 = P, E takes col 5 of row 1 = W. Result PW.
- ST: S (row 4, col 4), T (row 4, col 5). Same row: S becomes the letter to the right, T; T wraps around to N. Result TN.
Ciphertext: NZ AF PF PW TN (NZAFPFPWTN).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
Explain any two modes of block cipher encryption.
Answer
Modes of block cipher encryption
A block cipher encrypts only a fixed-size block (64 bits for DES, 128 for AES), so a mode of operation is used to encrypt messages of arbitrary length. Two important modes are explained here ( plaintext block, ciphertext block, the block cipher with key ).
1. Electronic Codebook (ECB)
Each plaintext block is encrypted separately with the same key:
- Blocks can be processed in parallel and an error in one block does not affect others.
- Identical plaintext blocks give identical ciphertext blocks, so patterns in the data are visible. It is therefore unsuitable for long or structured messages and is used only for short data such as key transport.
2. Cipher Block Chaining (CBC)
Each plaintext block is XORed with the previous ciphertext block before it is encrypted. The first block uses a random initialisation vector (IV):
- The same plaintext blocks produce different ciphertext, so patterns are hidden.
- Encryption is sequential (not parallel); decryption can be parallel.
- A bit error in garbles and flips the corresponding bit in only.
- The IV need not be secret but should be unpredictable and is sent with the ciphertext.
- It is used for general data encryption and for CBC-MAC authentication.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
State Fermat’s theorem with example. What is the implication of discrete logarithm?
Answer
Fermat's theorem
If is a prime and is an integer not divisible by , then An equivalent form, valid for every integer , is .
Example 1: , : , so .
Example 2 (use in computation): find . Since , .
Fermat's theorem is used for primality testing (Fermat and Miller-Rabin tests), for finding inverses (), and is a special case of Euler's theorem, which underlies RSA.
Implication of the discrete logarithm
By Fermat, the powers of a primitive root of cycle through with period . For the unique () is the discrete logarithm .
- Computing from is fast (square-and-multiply), but finding from is computationally infeasible for a large prime (no polynomial-time algorithm is known; the best known methods are sub-exponential).
- This one-way property is the foundation of the security of Diffie-Hellman key exchange, ElGamal encryption, DSA and elliptic-curve cryptography. An attacker who sees the public values cannot recover the private exponents.
- The consequence for design is that must be large (at least 2048 bits for classical groups) and a primitive root, otherwise the group is small and the logarithm is easy to find. A quantum computer running Shor's algorithm could solve it efficiently, which motivates post-quantum cryptography.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
Describe the working mechanism of digital signature algorithm.
Answer
Digital Signature Algorithm (DSA)
DSA is the NIST Digital Signature Standard (FIPS 186). It provides authentication, integrity and non-repudiation, but not encryption. Its security rests on the discrete logarithm problem. It uses SHA to hash the message.
Global public parameters
- : a large prime of 512 to 3072 bits ( bits).
- : a prime divisor of of 160 to 256 bits ( bits).
- , where and . Then has order mod .
Keys
- Private key: a random integer with .
- Public key: .
Signing a message
- Choose a random per-message secret , .
- Compute .
- Compute .
- The signature is the pair . If or , choose a new .
Verifying on a received
- Check and .
- Compute .
- and .
- .
- The signature is valid if .
Why it works: , so . Hence , and .
The value must be secret, random and never reused; otherwise the private key can be recovered.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
List and explain the types of firewall.
Answer
Types of firewall
A firewall controls traffic between a trusted and an untrusted network according to a security policy. The main types are the following.
1. Packet-filtering firewall (network layer). Examines each packet separately against rules based on source and destination IP, port, protocol and flags (ACLs), and permits or drops it. It is fast and cheap and transparent to users. But it knows nothing of connection state or application data, and is weak against IP spoofing and fragmentation attacks.
2. Stateful inspection firewall (network and transport layers). Keeps a table of active connections (addresses, ports, TCP state and sequence numbers) and allows a packet only if it belongs to a valid, established connection or matches a rule for a new one. It provides better security than simple packet filtering at moderate cost.
3. Circuit-level gateway (session layer). Acts as a relay between two TCP connections, checking the TCP handshake and session validity, then passing data without looking at its content. It hides the internal network but cannot detect malicious content within allowed sessions. Example: SOCKS.
4. Application-level gateway / proxy firewall (application layer). For each service (HTTP, FTP, SMTP) a proxy accepts the client's request, examines the application data and makes a new request to the server on the client's behalf. It gives the finest control (content filtering, user authentication, logging) and complete hiding of internal hosts, but is slow and needs a proxy for each application.
5. Next-generation firewall (NGFW). Combines stateful inspection with deep packet inspection, intrusion prevention, application awareness and user identity.
By implementation firewalls are also classed as host-based (software on one machine, personal firewall) and network-based (dedicated device or appliance at the perimeter). Common configurations are the bastion host, screened host and screened subnet (DMZ).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
Decrypt the ciphertext “HI” using Hill Cipher where the key is [5/4 3/3].
Answer
Hill cipher decryption of "HI" with key
Decryption: .
Ciphertext vector. H = 7, I = 8, so .
Determinant. . Since , the key is invertible. The inverse of 3 mod 26 is 9, because .
Inverse matrix.
Check: first row: ; . Second row: ; . So .
Plaintext.
(; .)
The numbers 5 and 15 correspond to F and P.
Plaintext: "FP".
Check by encryption: = HI.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
What is digital certificate? Discuss the certificate life cycle.
Answer
Digital certificate
A digital certificate is an electronic document that binds a public key to the identity of its owner (a person, server or organisation). It is issued and digitally signed by a trusted Certification Authority (CA), so anyone who trusts the CA can trust that the public key belongs to the named subject. The common format is X.509, which contains: version, serial number, signature algorithm, issuer name, validity period (not before / not after), subject name, subject public key, extensions, and the CA's digital signature.
Certificate life cycle
- Key generation and request. The subject generates a key pair and sends a Certificate Signing Request (CSR) with the public key and identity details to the Registration Authority (RA).
- Registration and verification. The RA/CA verifies the identity of the applicant (domain control, documents).
- Issuance. The CA signs the certificate with its private key and delivers it. It is published in a repository or directory.
- Use / validation. Relying parties check the CA signature, the validity period, the intended use and that the certificate has not been revoked, using a CRL (Certificate Revocation List) or OCSP.
- Renewal / re-key. Before expiry the subject obtains a new certificate with the same or a new key pair.
- Revocation. If the private key is compromised, details change or the certificate is misused, the CA revokes it before expiry and lists it in the CRL.
- Expiry / destruction. After its validity ends, the certificate is no longer valid; keys are archived or securely destroyed.
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
- 2082 · 5 marks
Define authentication system. Discuss about challenge response system.
Answer
Authentication system
Authentication is the process of verifying that a user, device or process is who it claims to be before access is granted. An authentication system implements this verification, normally using one or more factors:
- Something you know: password, PIN.
- Something you have: smart card, token, mobile phone.
- Something you are: fingerprint, iris, face (biometrics).
Using two or more factors gives multi-factor authentication. The system includes the credential store, the verification protocol and the access decision (for example, passwords, Kerberos, or certificate-based authentication).
Challenge-response system
In a challenge-response scheme the secret is never sent. Instead the verifier sends a challenge and the user proves knowledge of the secret by computing a response from it.
Working:
- The client sends its identity to the server.
- The server sends a fresh, unpredictable challenge (a random nonce).
- The client computes the response using the shared secret: , for example , , or a digital signature with its private key.
- The server computes the expected value with its own copy of the secret (or verifies the signature with the public key) and grants access if they match.
Since is different each time, a captured response cannot be replayed, and the password is never exposed on the network. Examples: CHAP, HTTP digest authentication, Kerberos nonces, hardware tokens that answer a numeric challenge. Weaknesses: it is open to man-in-the-middle relaying and offline dictionary attacks if the secret is a weak password; the server needs to hold the secret (unless public-key based).
Answer checked by Claude Sonnet · Oct 21, 2026
Test yourself · 2 MCQs
Loading…
Questions from TU BSc CSIT 2076 Cryptography (TU IOST board exam, 2076), TU BSc CSIT 2078 Cryptography (TU IOST board exam, 2078), TU BSc CSIT 2079 Cryptography (TU IOST board exam, 2079), TU BSc CSIT 2080 Cryptography (TU IOST board exam, 2080), TU BSc CSIT 2081 Cryptography (TU IOST board exam, 2081), TU BSc CSIT 2082 Cryptography (TU IOST board exam, 2082), TU BSc CSIT 2076 Design and Analysis of Algorithms (TU IOST board exam, 2076), TU BSc CSIT 2078 Design and Analysis of Algorithms (TU IOST board exam, 2078), TU BSc CSIT 2079 Design and Analysis of Algorithms (TU IOST board exam, 2079), TU BSc CSIT 2080 Design and Analysis of Algorithms (TU IOST board exam, 2080), TU BSc CSIT 2081 Design and Analysis of Algorithms (TU IOST board exam, 2081), TU BSc CSIT 2082 Design and Analysis of Algorithms (TU IOST board exam, 2082), TU BSc CSIT 2080 Image Processing (TU IOST board exam, 2080), TU BSc CSIT 2081 Image Processing (TU IOST board exam, 2081), TU BSc CSIT 2082 Image Processing (TU IOST board exam, 2082), TU BSc CSIT 2080 Multimedia Computing (TU IOST board exam, 2080), TU BSc CSIT 2081 Multimedia Computing (TU IOST board exam, 2081), TU BSc CSIT 2082 Multimedia Computing (TU IOST board exam, 2082), TU BSc CSIT 2076 System Analysis and Design (TU IOST board exam, 2076), TU BSc CSIT 2078 System Analysis and Design (TU IOST board exam, 2078), TU BSc CSIT 2079 System Analysis and Design (TU IOST board exam, 2079), TU BSc CSIT 2080 System Analysis and Design (TU IOST board exam, 2080), TU BSc CSIT 2081 System Analysis and Design (TU IOST board exam, 2081), TU BSc CSIT 2082 System Analysis and Design (TU IOST board exam, 2082), TU BSc CSIT 2076 Society and Ethics in Information Technology (TU IOST board exam, 2076), TU BSc CSIT 2078 Society and Ethics in Information Technology (TU IOST board exam, 2078), TU BSc CSIT 2079 Society and Ethics in Information Technology (TU IOST board exam, 2079), TU BSc CSIT 2076 Simulation and Modeling (TU IOST board exam, 2076), TU BSc CSIT 2078 Simulation and Modeling (TU IOST board exam, 2078), TU BSc CSIT 2079 Simulation and Modeling (TU IOST board exam, 2079), TU BSc CSIT 2080 Simulation and Modeling (TU IOST board exam, 2080), TU BSc CSIT 2081 Simulation and Modeling (TU IOST board exam, 2081), TU BSc CSIT 2082 Simulation and Modeling (TU IOST board exam, 2082), TU BSc CSIT 2076 Web Technology (TU IOST board exam, 2076), TU BSc CSIT 2078 Web Technology (TU IOST board exam, 2078), TU BSc CSIT 2079 Web Technology (TU IOST board exam, 2079), TU BSc CSIT 2080 Web Technology (TU IOST board exam, 2080), TU BSc CSIT 2081 Web Technology (TU IOST board exam, 2081) and TU BSc CSIT 2082 Web Technology (TU IOST board exam, 2082). Answers are written for this site; check them against your class notes.