Information SecurityUnit 1111 min read
Advanced Cryptography & Security: Post-Quantum, Zero-Knowledge & Trust Models
Unit 11 of Information Security explores cutting-edge cryptographic techniques (post-quantum algorithms, zero-knowledge proofs, homomorphic encryption) and advanced security frameworks (blockchain trust models, secure multi-party computation). It contrasts classical vs. quantum-resistant schemes, analyzes real-world at
Core Concepts & Definitions
1. Post-Quantum Cryptography (PQC)
Definition: Cryptographic algorithms resistant to attacks by quantum computers (e.g., Shor’s algorithm breaking RSA/ECC). Focuses on hard problems like:
- Lattice-based: Hardness of finding short vectors in high-dimensional lattices (e.g., Kyber, Dilithium).
- Hash-based: One-time signatures (e.g., SPHINCS+).
- Code-based: Decoding random linear codes (e.g., McEliece).
- Multivariate: Solving systems of nonlinear equations (e.g., Rainbow).
Why it matters:
- Nepal’s NTC is piloting PQC for fiber-optic backbone encryption to counter quantum hacking.
- eSewa uses lattice-based signatures for transaction authenticity (resistant to future quantum decryption).
Worked Example: Encrypting a Daraz order receipt (1KB) with Kyber-768 (post-quantum KEM):
- KeyGen: Generate
(pk, sk)wherepkis 1184 bytes,skis 2400 bytes. - Encapsulate: Sender computes
(ct, ss) = Encapsulate(pk)→ct= 1184 bytes,ss= 32 bytes. - Decapsulate: Receiver recovers
ss = Decapsulate(sk, ct). - Hybrid Encrypt: Use
ssas AES-256 key to encrypt the receipt. Result: Quantum-safe encryption with 256-bit classical security.
2. Zero-Knowledge Proofs (ZKPs)
Definition: A prover convinces a verifier of a statement’s truth without revealing anything else. Types:
- Interactive: Real-time exchanges (e.g., Schnorr protocol).
- Non-interactive (NIZK): Single message (e.g., zk-SNARKs in Zcash).
- Statistical/Computational/Perfect: Trade-offs between soundness and efficiency.
stateDiagram-v2
[*] --> Prover: "Knows secret w"
Prover --> Verifier: "Prove(x, w)"
Verifier --> Prover: "Challenge c"
Prover --> Verifier: "Response r"
Verifier --> [*]: "Accept/Reject"
note right of Prover: "No info about w leaked"Real-World Use:
- WhatsApp: Uses ZKPs for end-to-end key verification (e.g., proving you control
+977981234567without exposing the key). - NEPSE: Auditors verify shareholder votes via ZKPs to ensure ballot secrecy while proving validity.
Worked Example: Proving you know a Kathmandu traffic route’s hash without revealing the route:
- Setup: Hash function
H: {routes} → {0,1}^256. - Prove: For route
R = ["Ring Road", "Kantipath", "Durbar Square"]:- Compute
h = H(R),r = random(256 bits). - Send
(h ⊕ r, r)to verifier.
- Compute
- Challenge: Verifier picks
c = 0/1. - Response: Send
Rifc=0, else sendr. - Verify: Check
H(R) ⊕ r == hifc=0, orh ⊕ r == hifc=1. Outcome: Verifier confirms you knowRbut learns nothing aboutR.
3. Homomorphic Encryption (HE)
Definition: Encrypted data can be processed without decryption. Types:
| Type | Operation Support | Use Case |
|---|---|---|
| Partially HE | Single op (e.g., add) | Privacy-preserving databases |
| Somewhat HE | Limited ops (e.g., 100) | Secure cloud computation |
| Fully HE | Arbitrary circuits | Encrypted voting (e.g., Helios) |
Example Algorithms:
- Paillier: Additive homomorphism (e.g.,
E(a) * E(b) = E(a+b)). - TFHE: Supports Boolean circuits (e.g., encrypted AND/OR gates).
Real-World Use:
- Khalti: Uses HE to let banks compute loan eligibility (e.g.,
income > threshold) on encrypted user data. - Google: Cloud AI processes encrypted medical records via HE.
Worked Example: Calculating a bank’s loan interest without decrypting the principal:
- Setup: Client encrypts
P = 1,000,000(principal) under Paillier:E(P). - Server: Computes
E(interest) = E(P) * E(1.05)^12(5% annual for 12 months). - Result: Client decrypts
E(interest)to get1,628,895without exposingP.
4. Secure Multi-Party Computation (SMC)
Definition: Multiple parties jointly compute a function over private inputs without revealing inputs. Example protocols:
- Garble Circuits: Convert computation to a Boolean circuit, then "garble" it.
- Secret Sharing: Split inputs (e.g., Shamir’s scheme) and compute on shares.
sequenceDiagram
participant Alice
participant Bob
participant Server
Alice->>Server: "Share A1, A2 of secret x"
Bob->>Server: "Share B1, B2 of secret y"
Server->>Server: "Compute f(A1+B1, A2+B2)"
Server-->>Alice: "Result share R1"
Server-->>Bob: "Result share R2"
Alice->>Bob: "Combine R1+R2 to get f(x,y)"Real-World Use:
- Ncell: Partners with banks to compute joint credit scores (e.g.,
score = 0.7*bank_data + 0.3*call_data) without sharing raw data. - Daraz: Uses SMC to merge buyer/seller ratings without exposing individual reviews.
Worked Example: Two banks (A, B) compute a joint loan approval without sharing customer data:
- Input Splitting:
- Bank A: Splits
credit_score_A = 750intoA1 = 300,A2 = 450. - Bank B: Splits
income_B = 50,000intoB1 = 20,000,B2 = 30,000.
- Bank A: Splits
- Shared Computation:
- Server computes
f(A1+B1, A2+B2) = (300+20000) * (450+30000) mod p.
- Server computes
- Result Reconstruction:
- Banks combine shares to get
f(750, 50000) = 37,500,000,000(approval threshold).
- Banks combine shares to get
5. Blockchain & Trustless Systems
Key Concepts:
- Smart Contracts: Self-executing agreements (e.g., Ethereum’s Solidity).
- Consensus: PoW (Bitcoin), PoS (Ethereum 2.0), DAG (IOTA).
- Trust Models: Decentralized (Bitcoin), Federated (Ripple), Hybrid (eSewa’s blockchain).
Real-World Use:
- NEPSE: Uses blockchain to audit share transfers without clearinghouse delays.
- Pathao: Smart contracts auto-split driver-passenger payments (e.g., 80% driver, 20% platform).
Worked Example: eSewa’s hybrid trust model for bill payments:
- Off-Chain: User selects "Electricity Bill" →
+977981234567. - On-Chain: eSewa’s smart contract:
- Verifies user’s zero-knowledge proof of identity (ZKP).
- Locks
500 NPRin a multi-sig wallet (eSewa + NTC).
- Execution: NTC releases bill credit upon contract fulfillment.
6. Advanced Attacks & Defenses
Quantum Attacks
| Attack | Target | Defense |
|---|---|---|
| Shor’s Algorithm | RSA/ECC | Migrate to Kyber/Dilithium |
| Grover’s | Symmetric keys | Double key length (AES-256 → AES-512) |
Side-Channel Attacks
- Timing Attacks: Measure encryption speed to guess keys (e.g., AES timing leaks). Defense: Constant-time implementations (e.g., Libsodium).
- Power Analysis: Monitor CPU power draw during decryption. Defense: Masking techniques (e.g., randomize intermediate values).
Real-World Example:
- Ncell’s SIM cards were vulnerable to power-analysis attacks on DES keys. Fixed via AES-256 + constant-time libraries.
7. Security Auditing & Formal Verification
Audit Trail Requirements:
- Immutability: Tamper-proof logs (e.g., append-only databases).
- Non-repudiation: Cryptographic signatures (e.g., Lamport signatures).
- Granularity: Log user actions (e.g.,
user:alice, action:transfer, amount:500).
Formal Verification Tools:
- ProVerif: Verify cryptographic protocols (e.g., TLS 1.3).
- Z3: SMT solver for HE circuit correctness.
Worked Example: Auditing a bank’s SMC loan calculation:
- Log Entry:
{ "timestamp": "2023-10-15T12:00:00Z", "action": "compute_loan", "inputs": ["A1=300", "B1=20000"], "output": "R1=30300", "signer": "bankA_ed25519_pk" } - Verification:
- Check
Ed25519.Verify(signer, hash(log), sk). - Recompute
f(A1+B1, A2+B2)to matchR1.
- Check
In the Real World
eSewa’s Quantum-Resistant Payments:
- Idea: Uses Dilithium (NIST PQC finalist) for transaction signatures.
- How: When you pay a bill, eSewa’s server:
- Generates a Dilithium key pair
(pk, sk). - Signs the transaction with
sk. - Stores only
pkon-chain (quantum-safe).
- Generates a Dilithium key pair
Khalti’s Homomorphic Loan Eligibility:
- Idea: TFHE lets banks compute
if (income > threshold AND credit_score > X) approve()without decrypting inputs. - How: A user encrypts
(income=50000, score=750)→ Khalti’s server processes the encrypted data and returnsTrue/False.
- Idea: TFHE lets banks compute
NEPSE’s Zero-Knowledge Share Transfers:
- Idea: zk-SNARKs prove share ownership without revealing the holder.
- How: When you sell shares, NEPSE’s system:
- You prove knowledge of the private key (ZKP).
- The blockchains updates ownership without exposing your wallet address.
Exam Tip
What Examiners Want to See
| Question Type | Key Points to Include | Common Pitfalls to Avoid |
|---|---|---|
| Define PQC/HE/ZKP | Hardness assumptions + real-world example | Vague definitions (e.g., "HE lets you compute on encrypted data" without specifying limits). |
| Compare protocols | Table with operations supported, use cases, and trade-offs (e.g., ZKP vs. SMC). | Forgetting to mention interactivity (e.g., ZKPs need rounds vs. NIZKs don’t). |
| Worked examples | Step-by-step trace with numbers (e.g., Kyber key sizes). | Using toy examples (e.g., "encrypt hello") instead of real scenarios (e.g., Daraz order). |
| Attacks/Defenses | Specific algorithm targeted (e.g., "Grover’s breaks AES-128") + quantitative impact (e.g., "reduces security to 64 bits"). | Generic answers like "use strong passwords." |
| Audit trails | Immutability + cryptographic binding (e.g., hashes/signatures). | Ignoring non-repudiation or granularity. |
High-Scoring Strategies
- Use real systems: Always tie answers to eSewa, Khalti, NEPSE, or global platforms (e.g., "Like WhatsApp’s key verification, this protocol...").
- Show math: For PQC/HE, include one concrete calculation (e.g., Kyber key sizes or Paillier homomorphism).
- Draw the flow: For ZKPs/SMC, sequence diagrams or state machines score full marks.
- Contrast classical vs. advanced:
- "Unlike RSA (broken by Shor’s), Kyber uses lattice problems resistant to quantum attacks."
- Audit trail tip: Always mention three properties: immutability, non-repudiation, and granularity.
Based on the TU BCA syllabus for Information Security (CACS459), unit 11.
Discussion
Loading…