BSc CSIT (TU) Science Cryptography (BSc CSIT, CSC316) Question Paper 2079 Nepal
This is the official BSc CSIT (TU) (Science stream) Cryptography (BSc CSIT, CSC316) question paper for 2079, 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 2079 paper is a great way to practise under real exam conditions.
Section A: Long Answer Questions
Attempt any TWO questions.
What are cryptographic hash functions? Explain the SHA-1 algorithm and describe how a 160-bit message digest is generated.
Cryptographic Hash Functions
A cryptographic hash function maps a message of arbitrary length to a fixed-length output called the message digest. It must satisfy:
- Pre-image resistance (one-way): given , it is infeasible to find with .
- Second pre-image resistance: given , it is infeasible to find with .
- Collision resistance: it is infeasible to find any pair with .
- Avalanche effect: a 1-bit change in input flips ~half the output bits.
Uses: integrity checks, digital signatures, MACs, password storage.
SHA-1 Algorithm
SHA-1 takes a message of length bits and produces a 160-bit digest. It follows the Merkle–Damgård construction.
Step 1 – Padding. Append a 1 bit, then 0 bits, until the length . Append the original message length as a 64-bit integer, making the total a multiple of 512 bits.
Step 2 – Parse into blocks. Split into blocks of 512 bits each; each block is 16 words of 32 bits.
Step 3 – Initialize 5 chaining variables (160 bits total):
Step 4 – Message schedule. Expand the 16 words to 80 words:
Step 5 – Compression (80 rounds in 4 stages of 20). Set . For :
where the round function and constant change each 20-round stage:
| Rounds | ||
|---|---|---|
| 0–19 | 5A827999 | |
| 20–39 | 6ED9EBA1 | |
| 40–59 | 8F1BBCDC | |
| 60–79 | CA62C1D6 |
Step 6 – Update chaining values (mod ):
Process all blocks; the final 160-bit digest is the concatenation .
SHA-1 is now considered broken for collision resistance (the 2017 SHAttered attack) and is deprecated in favour of SHA-2/SHA-3.
Explain classical encryption techniques. Describe the Playfair cipher and the Hill cipher with examples of encryption.
Classical Encryption Techniques
Classical ciphers are symmetric and fall into two families:
- Substitution – replace plaintext units with other symbols (Caesar, Playfair, Hill, Vigenère).
- Transposition – rearrange the positions of plaintext characters (rail fence, columnar).
Playfair Cipher
A digraph substitution cipher using a key matrix (I/J share a cell).
Key = MONARCHY, fill remaining letters of alphabet:
M O N A R
C H Y B D
E F G I/J K
L P Q S T
U V W X Z
Rules (process plaintext as pairs; insert X between repeats, pad with X):
- Same row → take letter to the right (wrap).
- Same column → take letter below (wrap).
- Otherwise (rectangle) → take the letter in the same row but the other pair's column.
Example: plaintext BALLOON → BA LX LO ON
- BA → IB
- LX → SU
- LO → PM (rectangle)
- ON → NA
Ciphertext = IBSUPMNA.
Hill Cipher
A polygraphic cipher using linear algebra mod 26. For block size , choose an invertible key matrix (). Encryption:
Example (): Let , plaintext HI .
Ciphertext = letters 19,2 = TC.
Decryption uses , computed via . Here , , giving , which recovers HI.
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 a message and the signer's private key, that lets anyone verify the message's origin and integrity using the signer's public key. It is the digital analogue of a handwritten signature but also binds to the message content.
Properties provided:
- Authentication – verifier is assured of the signer's identity.
- Integrity – any change to the message invalidates the signature.
- Non-repudiation – the signer cannot later deny signing, since only they hold the private key.
RSA Digital Signature Scheme
Key generation: choose primes ; ; ; pick with ; compute . Public key , private key .
Signing (signer uses private key on the hash of the message):
The signer sends .
Verification (verifier uses signer's public key):
Because , a valid signature recovers the hash. Signing the hash rather than keeps signatures short and avoids existential forgery on raw RSA.
Tiny example: ; , (since ). If : . Verify: ✓.
Role in Authentication and Non-repudiation
- Authentication: only the holder of the private key could have produced that verifies under the matching public key, proving identity.
- Non-repudiation: the binding between signer and message is verifiable by any third party, so the signer cannot deny authorship — essential for contracts, e-commerce and certificates. (Trust in the public key itself is established through a PKI / Certificate Authority.)
Section B: Short Answer Questions
Attempt any EIGHT questions.
State and explain Fermat's little theorem and Euler's theorem with examples.
Fermat's Little Theorem
If is prime and , then
Equivalently for all .
Example: : . ✓
Euler's Theorem
If , then
where is Euler's totient (count of integers in coprime to ). It generalises Fermat's theorem (for prime , ).
Example: : . ✓
Relevance: these theorems underpin RSA — the decryption exponent works because — and enable fast modular exponentiation.
Is a man-in-the-middle attack possible in the Diffie-Hellman algorithm? Justify your answer.
Yes — Diffie–Hellman is vulnerable to a Man-in-the-Middle (MITM) attack.
Plain Diffie–Hellman exchanges public values but provides no authentication of the parties, so an active attacker can sit between Alice and Bob.
The attack: Alice and Bob agree on prime and generator .
- Alice sends ; attacker Mallory intercepts it and instead sends Bob .
- Bob sends ; Mallory intercepts and sends Alice .
- Alice computes shared key .
- Bob computes shared key .
Now Mallory shares with Alice and with Bob, can decrypt, read/modify, and re-encrypt all traffic — neither party detects it.
Why: DH guarantees secrecy of the discrete log but does not bind a public value to an identity.
Countermeasure: authenticated Diffie–Hellman — sign the exchanged values (e.g., station-to-station protocol), use certificates/PKI, or combine DH with pre-shared keys, so each side verifies the peer's identity.
Explain the families of SHA-2 and their differences from SHA-1.
SHA-2 Family
SHA-2 is a family of cryptographic hash functions standardised by NIST (FIPS 180-4), built on the Merkle–Damgård structure with two core compression functions (32-bit word for shorter, 64-bit word for longer variants):
| Variant | Digest size | Word size | Block size | Rounds |
|---|---|---|---|---|
| SHA-224 | 224 bits | 32-bit | 512 bits | 64 |
| SHA-256 | 256 bits | 32-bit | 512 bits | 64 |
| SHA-384 | 384 bits | 64-bit | 1024 bits | 80 |
| SHA-512 | 512 bits | 64-bit | 1024 bits | 80 |
| SHA-512/224, SHA-512/256 | 224/256 bits | 64-bit | 1024 bits | 80 |
SHA-224 is a truncated SHA-256 with different IVs; SHA-384 and SHA-512/t are truncated SHA-512.
Differences from SHA-1
| Aspect | SHA-1 | SHA-2 |
|---|---|---|
| Digest length | 160 bits (fixed) | 224–512 bits (selectable) |
| Rounds | 80 | 64 (256-family) / 80 (512-family) |
| Working variables | 5 () | 8 () |
| Message schedule | simple XOR + ROTL¹ | richer functions |
| Security | broken (collisions found, 2017) | no practical collision attack |
| Each round constant | 4 constants (one per 20 rounds) | distinct constant every round |
Summary: SHA-2 offers longer digests, more chaining variables, a stronger message schedule and per-round constants, giving far greater collision resistance than SHA-1.
What is Public Key Infrastructure (PKI)? Explain the role of a Certificate Authority and digital certificates.
Public Key Infrastructure (PKI)
PKI is the framework of hardware, software, policies, standards and procedures used to create, manage, distribute, store and revoke digital certificates and public keys. It solves the key-distribution / trust problem of asymmetric cryptography by reliably binding a public key to a verified identity.
Main components:
- Certificate Authority (CA) – trusted third party that issues and signs certificates.
- Registration Authority (RA) – verifies identity before the CA issues a certificate.
- Certificate Repository / Directory – stores and publishes certificates.
- CRL / OCSP – mechanisms to check revoked certificates.
Role of the Certificate Authority
The CA is the root of trust. It:
- Verifies the applicant's identity (via the RA).
- Binds the subject's identity to their public key and digitally signs the certificate with the CA's private key.
- Publishes and renews certificates, and revokes compromised ones (publishing a CRL).
Anyone holding the CA's public key can verify the CA's signature and thus trust the certified public key.
Digital Certificates
A digital certificate (typically X.509) is a signed data structure binding a public key to an identity. Key fields:
- Version, serial number
- Subject name and subject public key
- Issuer (CA) name
- Validity period (not-before / not-after)
- Signature algorithm and the CA's digital signature
When a user presents a certificate, the verifier checks the CA's signature, the validity dates and revocation status before trusting the enclosed public key (used in TLS/HTTPS, S/MIME, code signing).
Explain the basic logic of malicious code: viruses, worms and trojan horses.
Malicious Code
Malicious code (malware) is software intentionally written to damage, disrupt or gain unauthorised access to systems. Three classic types:
Virus
A program fragment that attaches itself to a host program or file and replicates when that host is executed. It needs a host and usually user action (running the infected file) to spread. Phases: dormant → propagation → triggering → execution (payload). Example: boot-sector and macro viruses.
Worm
A standalone, self-replicating program that spreads automatically across networks by exploiting vulnerabilities, without needing a host file or user action. It consumes bandwidth/resources and propagates very fast. Example: the Morris worm, Code Red.
Trojan Horse
A program that appears legitimate/useful but hides a malicious payload. It does not self-replicate; it relies on tricking the user into installing it, then performs hidden actions such as opening a backdoor, stealing data or installing other malware.
Key Differences
| Feature | Virus | Worm | Trojan |
|---|---|---|---|
| Self-replicating | Yes (with host) | Yes (standalone) | No |
| Needs host file | Yes | No | No |
| Spreads over 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)
If are pairwise coprime positive integers and , then the system
has a unique solution modulo , given by
Worked Example
Solve:
Here .
| 1 | 3 | 2 | 35 | , |
| 2 | 5 | 3 | 21 | |
| 3 | 7 | 2 | 15 |
Check: ✓, ✓, ✓. So (CRT speeds up RSA decryption via mod and mod ).
Explain the goals of security: confidentiality, integrity and availability. List the different types of security attacks.
Goals of Security (the CIA Triad)
- Confidentiality – ensuring information is accessible only to authorised parties; prevents unauthorised disclosure. Achieved by encryption and access control.
- Integrity – ensuring data is not altered in an unauthorised or undetected way; messages received are exactly as sent. Achieved by hashes, MACs and digital signatures.
- Availability – ensuring authorised users can access systems and data when needed; resisting denial of service. Achieved by redundancy, backups and DoS protection.
(Often extended with Authentication and Non-repudiation.)
Types of Security Attacks
Passive attacks (observe, do not alter — hard to detect, prevent via encryption):
- Release of message contents (eavesdropping)
- Traffic analysis
Active attacks (alter data or affect operation — easier to detect, hard to prevent):
- Masquerade – one entity pretends to be another
- Replay – capturing and retransmitting data
- Modification of messages – altering message contents
- Denial of Service (DoS) – preventing legitimate use of resources
A further classification by Stallings: interruption (availability), interception (confidentiality), modification (integrity), and fabrication (authenticity).
Differentiate between symmetric and asymmetric key cryptography with examples.
Symmetric vs Asymmetric Key Cryptography
Symmetric (secret-key): a single shared key is used for both encryption and decryption.
Asymmetric (public-key): a mathematically related key pair — encrypt with the recipient's public key, decrypt with their private key (or sign with private, verify with public).
| Aspect | Symmetric | Asymmetric |
|---|---|---|
| Keys | One shared secret key | Public/private key pair |
| Speed | Very fast | Slow (100–1000× slower) |
| Key distribution | Hard (must share secret securely) | Easy (public key is open) |
| Number of keys for users | ||
| Main use | Bulk data encryption | Key exchange, digital signatures |
| Examples | DES, 3DES, AES, RC4, Blowfish | RSA, Diffie–Hellman, ECC, ElGamal |
Note: practical systems are hybrid — asymmetric crypto exchanges a symmetric session key, which then encrypts the bulk data (e.g., TLS).
Explain the Caesar cipher and the mono-alphabetic substitution cipher with examples of their cryptanalysis.
Caesar Cipher
A mono-alphabetic shift cipher: each letter is shifted by a fixed key .
Example (): HELLO → KHOOR.
Cryptanalysis: only 25 possible keys, so a brute-force attack trying every shift instantly breaks it. The key can also be found by recognising frequency patterns (e.g., the most common ciphertext letter likely maps to E).
Mono-alphabetic Substitution Cipher
Each plaintext letter maps to a fixed but arbitrary ciphertext letter (a permutation of the alphabet), giving a key space of , so brute force is infeasible.
Cryptanalysis: broken by frequency analysis, because the substitution preserves letter statistics:
- Count ciphertext letter frequencies and compare to English (
E≈12.7%,T,A,O,I,N…). - Map the most frequent ciphertext letters to common plaintext letters.
- Use digram/trigram patterns (
TH,HE,THE,ING) and word structure to refine and confirm the key.
Conclusion: both ciphers fail because they hide letter identity but not letter frequency; only the key space differs (25 vs ), yet both succumb to statistical cryptanalysis.
Frequently asked questions
- Where can I find the BSc CSIT (TU) Cryptography (BSc CSIT, CSC316) question paper 2079?
- The full BSc CSIT (TU) Cryptography (BSc CSIT, CSC316) 2079 (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) 2079 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) 2079 paper?
- The BSc CSIT (TU) Cryptography (BSc CSIT, CSC316) 2079 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.