CACS459 Information Security

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).
Shortest Vector Problem (SVP)Learning With Errors (LWE)Lattice-basedOne-time Signatures (e.g., SPHINCS+)Merkle TreesHash-basedMcEliece (Goppa codes)BIKE (Binary codes)Code-basedRainbowGeMSSMultivariatePost-Quantum Cryptography (PQC)
Hierarchy of Post-Quantum Cryptographic Algorithms (NIST PQC Finalists)

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):

  1. KeyGen: Generate (pk, sk) where pk is 1184 bytes, sk is 2400 bytes.
  2. Encapsulate: Sender computes (ct, ss) = Encapsulate(pk) → ct = 1184 bytes, ss = 32 bytes.
  3. Decapsulate: Receiver recovers ss = Decapsulate(sk, ct).
  4. Hybrid Encrypt: Use ss as 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 +977981234567 without 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:

  1. Setup: Hash function H: {routes} → {0,1}^256.
  2. Prove: For route R = ["Ring Road", "Kantipath", "Durbar Square"]:
    • Compute h = H(R), r = random(256 bits).
    • Send (h ⊕ r, r) to verifier.
  3. Challenge: Verifier picks c = 0/1.
  4. Response: Send R if c=0, else send r.
  5. Verify: Check H(R) ⊕ r == h if c=0, or h ⊕ r == h if c=1. Outcome: Verifier confirms you know R but learns nothing about R.

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)
PlaintextxCiphertextE(x)Encrypted ComputationE(f(x))Decrypted Resultf(x)
Homomorphic Encryption Workflow (e.g., Paillier, BFV schemes)

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:

  1. Setup: Client encrypts P = 1,000,000 (principal) under Paillier: E(P).
  2. Server: Computes E(interest) = E(P) * E(1.05)^12 (5% annual for 12 months).
  3. Result: Client decrypts E(interest) to get 1,628,895 without exposing P.

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:

  1. Input Splitting:
    • Bank A: Splits credit_score_A = 750 into A1 = 300, A2 = 450.
    • Bank B: Splits income_B = 50,000 into B1 = 20,000, B2 = 30,000.
  2. Shared Computation:
    • Server computes f(A1+B1, A2+B2) = (300+20000) * (450+30000) mod p.
  3. Result Reconstruction:
    • Banks combine shares to get f(750, 50000) = 37,500,000,000 (approval threshold).

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).
DecentralizedFederatedHybridPermissioned
Blockchain Trust Models by Consensus Mechanism

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:

  1. Off-Chain: User selects "Electricity Bill" → +977981234567.
  2. On-Chain: eSewa’s smart contract:
    • Verifies user’s zero-knowledge proof of identity (ZKP).
    • Locks 500 NPR in a multi-sig wallet (eSewa + NTC).
  3. 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:

  1. Immutability: Tamper-proof logs (e.g., append-only databases).
  2. Non-repudiation: Cryptographic signatures (e.g., Lamport signatures).
  3. 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:

  1. Log Entry:
    {
      "timestamp": "2023-10-15T12:00:00Z",
      "action": "compute_loan",
      "inputs": ["A1=300", "B1=20000"],
      "output": "R1=30300",
      "signer": "bankA_ed25519_pk"
    }
    
  2. Verification:
    • Check Ed25519.Verify(signer, hash(log), sk).
    • Recompute f(A1+B1, A2+B2) to match R1.

In the Real World

  1. eSewa’s Quantum-Resistant Payments:

    • Idea: Uses Dilithium (NIST PQC finalist) for transaction signatures.
    • How: When you pay a bill, eSewa’s server:
      1. Generates a Dilithium key pair (pk, sk).
      2. Signs the transaction with sk.
      3. Stores only pk on-chain (quantum-safe).
  2. 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 returns True/False.
  3. NEPSE’s Zero-Knowledge Share Transfers:

    • Idea: zk-SNARKs prove share ownership without revealing the holder.
    • How: When you sell shares, NEPSE’s system:
      1. You prove knowledge of the private key (ZKP).
      2. 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

  1. Use real systems: Always tie answers to eSewa, Khalti, NEPSE, or global platforms (e.g., "Like WhatsApp’s key verification, this protocol...").
  2. Show math: For PQC/HE, include one concrete calculation (e.g., Kyber key sizes or Paillier homomorphism).
  3. Draw the flow: For ZKPs/SMC, sequence diagrams or state machines score full marks.
  4. Contrast classical vs. advanced:
    • "Unlike RSA (broken by Shor’s), Kyber uses lattice problems resistant to quantum attacks."
  5. 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…