BSc CSIT (TU) Science Cryptography (BSc CSIT, CSC316) Question Paper 2081 Nepal
This is the official BSc CSIT (TU) (Science stream) Cryptography (BSc CSIT, CSC316) question paper for 2081, as set in the regular annual examination. It carries 60 full marks and a time allowance of 180 minutes, across 12 questions. On Kekkei you can attempt this Cryptography (BSc CSIT, CSC316) past paper online with a timer, get instant AI feedback and step-by-step solutions, and track the topics where you lose marks — completely free. Whether you are revising for your BSc CSIT (TU) Cryptography (BSc CSIT, CSC316) exam or solving previous years' question papers, this 2081 paper is a great way to practise under real exam conditions.
Section A: Long Answer Questions
Attempt any TWO questions.
What is a digital signature? Explain the digital signature scheme using RSA and the role of digital signatures in authentication and non-repudiation.
Digital Signature
A digital signature is a cryptographic value, computed from the data and a signer's private key, that binds the identity of the signer to the message. It provides authentication, data integrity, and non-repudiation. Unlike a handwritten signature, it is a function of the message itself, so any change to the message invalidates the signature.
Digital Signature Using RSA
RSA signing is the reverse of RSA encryption: the signer uses the private key to sign, and any verifier uses the public key to verify.
Key setup (same as RSA):
- Choose primes ; compute and .
- Choose public exponent with ; compute private exponent .
- Public key: ; private key: .
Signing (by sender A): compute a hash of the message, then
A sends .
Verification (by receiver B): using A's public key,
and independently compute . If , the signature is valid.
In practice the message is hashed first (e.g. SHA-256) so that signing works on a fixed-size digest and to prevent existential forgery.
Role in Authentication and Non-Repudiation
- Authentication: Only the holder of the private key could have produced such that equals the message hash. Successful verification with A's public key proves the message came from A.
- Integrity: If the message is altered in transit, changes and verification fails.
- Non-repudiation: Because only A possesses the private key , A cannot later deny having signed the message — a third party can verify the signature using the publicly known key, providing legal/dispute-resolution evidence.
Explain the RSA algorithm. Show how encryption and decryption are performed. Choose two primes p=7 and q=11, compute the public and private key pairs and encrypt the message M=8.
RSA Algorithm
RSA is a public-key (asymmetric) cryptosystem whose security rests on the difficulty of factoring large integers.
Key Generation
- Choose two large primes and .
- Compute .
- Compute Euler's totient .
- Choose public exponent with and .
- Compute private exponent .
- Public key: Private key: .
Encryption / Decryption
- Encryption: .
- Decryption: .
Worked Example: , ,
Step 1 — n: .
Step 2 — totient: .
Step 3 — choose e: pick (since ).
Step 4 — compute d: find with . , so .
- Public key:
- Private key:
Step 5 — encrypt M = 8:
Using successive squaring mod 77:
- .
- ; .
(Check: decryption recovers the message.)
Explain the structure of the Data Encryption Standard (DES) algorithm with a block diagram. Describe a single round of DES including the function F.
Data Encryption Standard (DES)
DES is a symmetric block cipher that encrypts 64-bit plaintext blocks under a 56-bit effective key (64-bit key with 8 parity bits) using a 16-round Feistel network.
Overall Structure (Block Diagram in words)
64-bit Plaintext
|
[Initial Permutation (IP)]
|
split -> L0 (32) | R0 (32)
|
Round 1 (uses subkey K1)
Round 2 (uses subkey K2)
...
Round 16 (uses subkey K16)
|
32-bit swap (R16 | L16)
|
[Inverse Initial Permutation (IP^-1)]
|
64-bit Ciphertext
A separate key schedule takes the 56-bit key, applies Permuted Choice 1 (PC-1), splits it into two 28-bit halves, and for each round performs left circular shifts followed by Permuted Choice 2 (PC-2) to produce sixteen 48-bit subkeys .
A Single DES Round (Feistel structure)
For round , given :
The right half is fed into the round function together with the round subkey, and the result is XORed with the left half.
The Function F (Mangler Function)
operates on a 32-bit input and a 48-bit subkey in four steps:
- Expansion (E): the 32-bit is expanded to 48 bits by the E-box (duplicating some bits).
- Key mixing: XOR the 48-bit expanded value with the 48-bit subkey .
- Substitution (S-boxes): the 48 bits are split into eight 6-bit groups; each enters one of eight S-boxes, each outputting 4 bits → 32 bits total. The S-boxes provide non-linearity (confusion) and are the heart of DES security.
- Permutation (P): the 32-bit S-box output is permuted by the P-box to spread bits (diffusion).
After 16 rounds the halves are swapped and passed through to yield the ciphertext. Decryption uses the identical algorithm with subkeys applied in reverse order ().
Section B: Short Answer Questions
Attempt any EIGHT questions.
Explain the basic logic of malicious code: viruses, worms and trojan horses.
Malicious Code
Virus: A program fragment that attaches itself to a host file/program and replicates by inserting copies into other programs when the infected host is executed. It needs a host and usually user action (running the file) to spread, and carries a payload that may damage data.
Worm: A stand-alone, self-replicating program that spreads across networks on its own, without attaching to a host or requiring user action. It exploits vulnerabilities to copy itself to other machines, consuming bandwidth and resources (e.g. the Morris worm).
Trojan Horse: A program that masquerades as legitimate/useful software but secretly performs malicious actions (data theft, backdoor installation). It does not self-replicate; it relies on tricking the user into running it.
| Feature | Virus | Worm | Trojan |
|---|---|---|---|
| Self-replicating | Yes | Yes | No |
| Needs host file | Yes | No | No |
| Spreads via network alone | No | Yes | No |
| Relies on deception | Sometimes | No | Yes |
State the Chinese Remainder Theorem and use it to solve a system of congruences.
Chinese Remainder Theorem (CRT)
Statement: If are pairwise coprime positive integers, then the system
has a unique solution modulo .
Construction: Let and . Then
Example
Solve: .
- .
- , , .
- Inverses: (since ). . .
- .
- .
Check: , , . ✓
Explain the goals of security: confidentiality, integrity and availability. List the different types of security attacks.
Goals of Security (CIA Triad)
- Confidentiality: Ensures information is accessible only to authorized parties; data is protected from unauthorized disclosure (achieved via encryption, access control).
- Integrity: Ensures information is not altered in an unauthorized or undetected manner; data remains accurate and trustworthy (achieved via hashes, MACs, digital signatures).
- Availability: Ensures information and resources are accessible to authorized users when needed; systems resist disruption (achieved via redundancy, backups, DoS protection).
Types of Security Attacks
Passive attacks (eavesdropping; threaten confidentiality):
- Release of message contents (interception/snooping).
- Traffic analysis (inferring info from message patterns).
Active attacks (modify data/stream; threaten integrity & availability):
- Masquerade (impersonation / fabrication of identity).
- Replay (capturing and retransmitting data).
- Modification of messages (altering message contents).
- Denial of Service (DoS) (disrupting availability).
In terms of information flow these correspond to interception, modification, fabrication, and interruption.
Differentiate between symmetric and asymmetric key cryptography with examples.
Symmetric vs Asymmetric Key Cryptography
| Aspect | Symmetric Key | Asymmetric (Public) Key |
|---|---|---|
| Keys | Single shared secret key for both encrypt & decrypt | Key pair: public key encrypts, private key decrypts |
| Key sharing | Key must be secretly distributed (key-distribution problem) | Public key shared openly; private key kept secret |
| Speed | Fast, suitable for bulk data | Slow (heavy math), used for small data/keys |
| Number of keys (n users) | keys needed | keys (one pair per user) |
| Services | Confidentiality | Confidentiality, key exchange, digital signatures, non-repudiation |
| Examples | DES, 3DES, AES, RC4, Blowfish | RSA, Diffie-Hellman, ElGamal, ECC |
In practice the two are combined (hybrid cryptography): an asymmetric algorithm (e.g. RSA) securely exchanges a session key, and a fast symmetric algorithm (e.g. AES) encrypts the actual bulk data.
Explain the Caesar cipher and the mono-alphabetic substitution cipher with examples of their cryptanalysis.
Caesar Cipher
A monoalphabetic substitution cipher that shifts each letter by a fixed amount (classically ):
Example (): plaintext HELLO → ciphertext KHOOR.
Cryptanalysis: There are only 25 possible keys, so it is broken by brute force (exhaustive key search) — try all shifts until readable text appears.
General Monoalphabetic Substitution Cipher
Each plaintext letter is mapped to a fixed but arbitrary ciphertext letter (a permutation of the alphabet), giving keys — far too many for brute force.
Cryptanalysis: Broken by frequency analysis, because the cipher preserves letter-frequency statistics of the language. The analyst:
- Counts ciphertext letter frequencies.
- Maps the most frequent ciphertext letters to common English letters (
E,T,A,O...). - Uses digram/trigram patterns (
TH,THE) to confirm and complete the substitution.
Thus, despite the huge key space, the monoalphabetic cipher is insecure because it does not hide the underlying language statistics.
Explain modular arithmetic and Euler's totient function. Compute phi(35) and phi(24).
Modular Arithmetic
Modular arithmetic is arithmetic over a fixed modulus , where numbers "wrap around" after reaching . We write if , i.e. and leave the same remainder when divided by . Operations are well-defined on residue classes . It is the foundation of most public-key cryptography (RSA, Diffie-Hellman, ElGamal).
Euler's Totient Function
counts the integers in that are coprime to .
- For a prime : .
- For : .
- Multiplicative: if then .
Euler's theorem: if then .
Computations
: (both prime, coprime), so
: , so
Explain the ElGamal cryptographic system for encryption and decryption.
ElGamal Cryptosystem
ElGamal is a public-key cryptosystem whose security relies on the difficulty of the Discrete Logarithm Problem in a finite cyclic group.
Key Generation
- Choose a large prime and a primitive root (generator) of .
- Choose a private key with .
- Compute .
- Public key: Private key: .
Encryption (of message , )
Sender picks a random ephemeral key () and computes:
Ciphertext is the pair .
Decryption
Receiver uses private key :
This works because , which cancels the factor in .
Example (small numbers)
Let , , → . Public key . To encrypt with : , . Ciphertext .
Note: Because of the random , ElGamal is probabilistic — the same message encrypts to different ciphertexts each time, and the ciphertext is roughly twice the message size.
Differentiate between block ciphers and stream ciphers. Explain the different modes of operation of block ciphers.
Block Cipher vs Stream Cipher
| Aspect | Block Cipher | Stream Cipher |
|---|---|---|
| Processing unit | Fixed-size blocks (e.g. 64/128 bits) | One bit/byte at a time |
| Mechanism | Substitution-permutation / Feistel | XOR plaintext with a pseudorandom keystream |
| Speed/latency | Slower, needs full block | Fast, low latency |
| Error propagation | Errors affect whole block (mode-dependent) | Error usually stays in one bit/byte |
| Examples | DES, 3DES, AES | RC4, A5/1, ChaCha20 |
Modes of Operation of Block Ciphers
- ECB (Electronic Codebook): Each block encrypted independently: . Simple but identical plaintext blocks give identical ciphertext (leaks patterns) — insecure for structured data.
- CBC (Cipher Block Chaining): Each plaintext block is XORed with the previous ciphertext before encryption: , with . Hides patterns; errors propagate to two blocks.
- CFB (Cipher Feedback): Turns the block cipher into a self-synchronizing stream cipher: .
- OFB (Output Feedback): Generates a keystream independent of plaintext: , . No error propagation.
- CTR (Counter): Encrypts an incrementing counter to form a keystream: . Parallelizable and random-access.
All feedback modes require an Initialization Vector (IV) to ensure that identical plaintexts encrypt differently.
What is a Message Authentication Code (MAC)? Explain how HMAC works.
Message Authentication Code (MAC)
A MAC is a short, fixed-length tag computed from a message and a shared secret key : . It provides data integrity and authentication — the receiver, who shares , recomputes the MAC and accepts the message only if the tags match. An attacker without cannot forge a valid tag for a modified message. (A MAC does not provide non-repudiation, since both parties share the key.)
HMAC (Hash-based MAC)
HMAC builds a MAC from a cryptographic hash function (e.g. SHA-256) and a secret key , defined as:
where:
- = the byte
0x36repeated to block size, - = the byte
0x5Crepeated to block size, - denotes concatenation, is XOR, and is padded to the hash block size.
How it works:
- The key is padded and XORed with , prepended to the message, and hashed → inner hash.
- The key is padded and XORed with , prepended to the inner hash, and hashed again → final HMAC.
The two nested hashes with two key-derived values make HMAC resistant to length-extension and other attacks, so its security depends only on the strength of the underlying hash and the secrecy of .
Frequently asked questions
- Where can I find the BSc CSIT (TU) Cryptography (BSc CSIT, CSC316) question paper 2081?
- The full BSc CSIT (TU) Cryptography (BSc CSIT, CSC316) 2081 (regular) question paper is available free on Kekkei. You can read every question online and attempt the paper under timed exam conditions.
- Does the Cryptography (BSc CSIT, CSC316) 2081 paper come with solutions?
- Yes. Every question on this Cryptography (BSc CSIT, CSC316) past paper includes a step-by-step solution, plus instant AI feedback when you attempt it on Kekkei.
- How many marks is the BSc CSIT (TU) Cryptography (BSc CSIT, CSC316) 2081 paper?
- The BSc CSIT (TU) Cryptography (BSc CSIT, CSC316) 2081 paper carries 60 full marks and is meant to be completed in 180 minutes, across 12 questions.
- Is practising this Cryptography (BSc CSIT, CSC316) past paper free?
- Yes — reading and attempting this Cryptography (BSc CSIT, CSC316) past paper on Kekkei is completely free.