Cybersecurity & Cryptography Masterclass: CIA Triad, RSA Algorithm Math & AES Encryption for TU BCA
Author: Bhuban Subedi | Subject: Network Security & Cyber Law (CACS355) | Semester: Sixth / Seventh Semester
In an era of ubiquitous cloud computing, e-banking portals, and interconnected IoT devices, protecting digital assets against unauthorized interception and malicious tampering is paramount.
Cryptography is the science of transforming readable plaintext into unintelligible ciphertext using mathematical algorithms and cryptographic keys, ensuring communication privacy and message authentication.
In the Tribhuvan University (TU) BCA Network Security & Cyber Law (CACS355) board examinations, questions on the CIA Triad, Symmetric vs Asymmetric Encryption, and step-by-step RSA algorithm numerical calculations appear as high-scoring 10-mark examination problems.
In this guide, we will analyze foundational security pillars, compare AES vs RSA, understand digital signatures, and solve an authentic RSA mathematical problem.
1. The CIA Triad: The Cornerstone of Information Security
Every security control and cryptographic protocol is designed to uphold the three pillars of the CIA Triad:
+-------------------+
| CONFIDENTIALITY | (Encryption / Access Control)
+---------+---------+
|
+------------------+------------------+
| |
v v
+-------------------+ +-------------------+
| INTEGRITY | | AVAILABILITY |
| (Hashes & Sign.) | | (Redundancy / DoS)|
+-------------------+ +-------------------+
- Confidentiality: Guarantees that sensitive data is shielded from unauthorized observation (Achieved via AES / RSA Encryption).
- Integrity: Assures that data has not been modified, forged, or deleted in transit (Achieved via Cryptographic Hashes like SHA-256 and Digital Signatures).
- Availability: Ensures authorized users have timely, uninterrupted access to critical systems and data (Achieved via DDoS mitigation, load balancing, and RAID redundancy).
2. Symmetric vs. Asymmetric Cryptography
+------------------------------------+------------------------------------+
| Symmetric Encryption (Secret Key) | Asymmetric Encryption (Public Key) |
+------------------------------------+------------------------------------+
| Uses a **single shared secret key**| Uses a **mathematically linked key |
| for both encryption and decryption.| pair**: Public Key & Private Key. |
+------------------------------------+------------------------------------+
| **Key Distribution Problem:** How | Solves key distribution: Public key|
| to securely share secret key? | is published openly to everyone. |
+------------------------------------+------------------------------------+
| Extremely fast (Hardware-backed). | Computationally slower (Heavy math)|
+------------------------------------+------------------------------------+
| Standard: **AES-256**, DES, 3DES. | Standard: **RSA**, ECC, Diffie-Hell|
+------------------------------------+------------------------------------+
3. The RSA Public-Key Cryptosystem
Invented in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman, RSA relies on the practical difficulty of factoring the product of two large prime numbers.
Mathematical Key Generation Steps:
- Select two distinct prime numbers $p$ and $q$.
- Compute modulus: $$\mathbf{n = p \cdot q}$$
- Compute Euler’s Totient function: $$\mathbf{\phi(n) = (p – 1)(q – 1)}$$
- Choose public exponent $e$ such that:
$$\mathbf{1 < e < \phi(n) \quad \text{and} \quad \gcd(e, \phi(n)) = 1}$$ - Calculate private exponent $d$ such that:
$$\mathbf{d \cdot e \equiv 1 \pmod{\phi(n)} \implies d = e^{-1} \pmod{\phi(n)}}$$ - Public Key: $(e, n)$ | Private Key: $(d, n)$
Encryption & Decryption Formulas:
- Ciphertext: $$\mathbf{C = M^e \pmod n}$$
- Decrypted Plaintext: $$\mathbf{M = C^d \pmod n}$$
4. Solved TU Board Exam Numerical (RSA)
Board Question:
“In an RSA cryptosystem, the prime numbers are chosen as $p = 7$ and $q = 11$. The public encryption key is chosen as $e = 13$.
1. Calculate modulus $n$, totient $\phi(n)$, and the private key $d$.
2. Encrypt the plaintext message $M = 5$.
3. Decrypt the ciphertext to verify correctness.” (TU BCA 10 Marks)
Step-by-Step Solution:
Step 1: Compute Modulus $n$ and Totient $\phi(n)$
$$n = p \times q = 7 \times 11 = \mathbf{77}$$
$$\phi(n) = (p – 1)(q – 1) = (7 – 1)(11 – 1) = 6 \times 10 = \mathbf{60}$$
Step 2: Calculate Private Key Exponent $d$
We must find integer $d$ such that:
$$d \times 13 \equiv 1 \pmod{60}$$
$$(13d – 1) \text{ must be divisible by } 60$$
Testing values:
– For $k = 8$: $13d = 8 \times 60 + 1 = 481 \implies d = \frac{481}{13} = \mathbf{37}$.
$$\mathbf{Public\ Key:\ (e=13, n=77)} \quad | \quad \mathbf{Private\ Key:\ (d=37, n=77)}$$
Step 3: Encryption of Message $M = 5$
$$C = M^e \pmod n = 5^{13} \pmod{77}$$
Using modular exponentiation:
– $5^2 = 25 \pmod{77}$
– $5^4 = 25^2 = 625 = 8 \times 77 + 9 \equiv 9 \pmod{77}$
– $5^8 = 9^2 = 81 \equiv 4 \pmod{77}$
– $5^{13} = 5^8 \times 5^4 \times 5^1 \pmod{77}$
– $5^{13} = (4 \times 9 \times 5) \pmod{77} = 180 \pmod{77}$
– $180 = 2 \times 77 + 26 \equiv \mathbf{26}$
$$\mathbf{Ciphertext\ C = 26}$$
Step 4: Decryption of Ciphertext $C = 26$
$$M = C^d \pmod n = 26^{37} \pmod{77}$$
By Euler’s theorem: $26^{37} \equiv \mathbf{5} \pmod{77}$.
$$\mathbf{\therefore Recovered\ Plaintext\ M = 5 \quad [Verified\ Correctly]}$$
Frequently Asked Questions (FAQ)
Q1: What is a Digital Signature?
A Digital Signature provides non-repudiation and authentication by having the sender encrypt a cryptographic hash of the message with their Private Key. Anyone can verify the signature using the sender’s Public Key.
Q2: What is the difference between Hashing and Encryption?
- Encryption: Two-way reversible mathematical transformation (Plaintext $\leftrightarrow$ Ciphertext) using keys.
- Hashing: One-way irreversible fixed-length digest (e.g., SHA-256) used strictly for integrity checking.



