0% found this document useful (0 votes)
9 views17 pages

CST428 Module1

The document is a study guide for CST 428 on blockchain technologies, focusing on elliptic curve cryptography (ECC), hash functions, and digital signatures. It explains the concepts, properties, and applications of ECC, including its advantages over RSA, as well as the mechanics of digital signatures and the SHA-256 hashing algorithm. Key topics include ECC key exchange, encryption/decryption processes, and the role of digital signatures in blockchain technology.

Uploaded by

apotropaic726
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views17 pages

CST428 Module1

The document is a study guide for CST 428 on blockchain technologies, focusing on elliptic curve cryptography (ECC), hash functions, and digital signatures. It explains the concepts, properties, and applications of ECC, including its advantages over RSA, as well as the mechanics of digital signatures and the SHA-256 hashing algorithm. Key topics include ECC key exchange, encryption/decryption processes, and the role of digital signatures in blockchain technology.

Uploaded by

apotropaic726
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CST 428 – BLOCK CHAIN TECHNOLOGIES

MODULE 1 – STUDY GUIDE


Part 2: ECC → Digital Signatures → SHA-256 → Merkle Trees → DHT

Covers: Concept + Diagrams + PYQ Answers (Short & Long)


CHAPTER 1: ELLIPTIC CURVE CRYPTOGRAPHY (ECC)

1.1 What is ECC?


Elliptic Curve Cryptography (ECC) is an asymmetric public key cryptosystem that uses the mathematical
properties of elliptic curves over finite fields to provide security. It is an alternative to RSA that achieves the
same level of security with much smaller key sizes.

■ ECC = RSA but smarter — same security, smaller keys, faster speed, used in Bitcoin & Ethereum

1.2 The Curve Equation


y² = x³ + ax + b

Variables and coefficients are restricted to elements in a finite field. The curve used in cryptography is not
a smooth continuous curve — it is a set of discrete points satisfying the above equation over a finite field.

1.3 Properties of Elliptic Curve


• Symmetric over the x-axis
• A non-vertical line will intersect the curve at most 3 points

1.4 ECC Curve Diagram (Conceptual)


■■ The curve y² = x³ + ax + b looks like a smooth loop on the left and a curve extending right. Points P, Q,
R lie on the curve. A line through P and Q intersects at a third point R. The reflection of R over the x-axis
gives P+Q. This point addition is the core math operation.

Point Meaning in ECC

G Base/Generator point — public, everyone knows it

n (private) A secret random integer — private key

P = n×G Public key — calculated by multiplying n with G

Security Given P and G, finding n is computationally impossible (ECDLP)

1.5 Two Families of ECC Curves


Type Full Name Best For

Prime curves Over Zp — coefficients from 0 to p-1 Software applications

Binary curves Over GF(2^m) — coefficients in binary field Hardware applications

1.6 ECC vs RSA


Feature RSA ECC

Key size for same security 2048 bits 256 bits

Speed Slower Faster


Key generation Slow Fast

Used in Old/traditional systems Bitcoin, Ethereum, HTTPS

Security basis Integer factorization problem Elliptic Curve Discrete Log Problem (ECDLP)

1.7 Where ECC is Used


• Digital signatures in cryptocurrencies — Bitcoin and Ethereum
• One-way encryption of emails, data and software
• SSL/TLS — secure web connections (HTTPS)
• Fast key generation, key agreement and signatures

1.8 ECC Diffie-Hellman Key Exchange


This is the method by which two parties (Alice and Bob) generate a shared secret key over a public
channel without ever transmitting the actual key. This solves the key distribution problem.

Global Public Elements:


• Eq(a,b) — elliptic curve with parameters a, b and q (q is prime or of form 2^m)
• G — a point on the elliptic curve whose order is a large value n

Step User A (Alice) User B (Bob)

1. Select private key Choose nA where nA < n Choose nB where nB < n

2. Calculate public key PA = nA × G PB = nB × G

3. Exchange Send PA to Bob Send PB to Alice

4. Compute shared secret K = nA × PB K = nB × PA

Why both get the same K:


nA × PB = nA × (nB × G) = nB × (nA × G) = nB × PA = K

■■ Security: Eve can see PA and PB publicly but CANNOT reverse-calculate nA or nB. This is the Elliptic
Curve Discrete Logarithm Problem (ECDLP) — easy one way, impossible to reverse.

1.9 ECC Encryption and Decryption


In ECC, a message must first be represented as a point on the curve, called Pm.

Encryption (Alice sending to Bob):


• Alice picks a random positive integer k
• Ciphertext Cm = { kG , Pm + kPb }
• Part 1 (kG): the 'hint' Bob needs to decrypt
• Part 2 (Pm + kPb): the message locked using Bob's public key Pb

Decryption (Bob receiving):


• Bob receives { kG, Pm + kPb }
• Bob computes: nb × (kG) = k × (nb × G) = k × Pb
• Bob subtracts: (Pm + kPb) - nb(kG) = Pm + kPb - kPb = Pm ✓

Cm = { kG, Pm + kPb } Decrypt: Pm = (Pm + kPb) - nb(kG)

■ Alice hides the message by adding kPb. Bob removes it using his private key nb. Only Bob can do this.

1.10 PYQ Answers — ECC

■ SHORT ANSWER (2 marks) — Paper C: Differentiate ECC from RSA

Point RSA ECC

Key size 2048 bits 256 bits

Speed Slower Faster

Security basis Integer factorization ECDLP

Used in Traditional systems Bitcoin, Ethereum, HTTPS

■ LONG ANSWER (7 marks) — Paper C: Explain ECC algorithm

■ EXAM TIP: Structure your answer: Definition → Equation → Properties → Types → Key Exchange →
Encryption/Decryption → Applications. This covers all 7 marks.

Definition: ECC is an asymmetric public key cryptosystem that uses elliptic curves over finite fields. It
provides the same security as RSA with much smaller key sizes.

Equation: y² = x³ + ax + b where variables are restricted to a finite field.

Properties of curve: (1) Symmetric over x-axis (2) Non-vertical line intersects at most 3 points.

Types: Prime curves over Zp (software) and Binary curves over GF(2^m) (hardware).
Key Exchange: Uses Diffie-Hellman approach. Both parties pick private keys nA, nB. Calculate public
keys PA = nA×G and PB = nB×G. Shared secret K = nA×PB = nB×PA.

Encryption: Cm = {kG, Pm + kPb}. Decryption: Pm = (Pm + kPb) - nb(kG).

Applications: Bitcoin, Ethereum digital signatures, SSL/TLS, email encryption.


CHAPTER 2: HASH FUNCTIONS

2.1 What is a Hash Function?


A hash function takes a variable size message as input and produces a fixed size output called the
message digest or hash value. It is a one-way function — you cannot reverse the output to get back the
original input.

■ Hash = a fixed-size digital fingerprint of your data. Like a meat grinder — anything goes in, same size
comes out, you can never reverse it.

2.2 Key Properties of Hash Functions (Exam Favourite)


Property Meaning Simple Words

One-way Cannot get input from output Irreversible — no going back

Keyless Does not use any key Unlike encryption, no key needed

Fixed output Output always same size regardless of input Big file or small file — same size hash

Deterministic Same input always gives same output Hello → always same hash

Avalanche effect Tiny change in input = completely different output


Change one letter = totally new hash

Collision resistant Two different inputs never give same output Every input has unique fingerprint

2.3 Uses of Hash Functions


• Detecting integrity of a message (authentication)
• Creating digital signatures
• Password storage in databases
• Blockchain — every block stores a hash of previous block
• Merkle trees — tree of hashes for transaction verification

2.4 Types of Authentication Algorithms


Type How it works Example

Message Encryption Uses encryption algorithm on full message AES, RSA

Uses message + key → fixed length code appended to


Message Authentication Code (MAC) HMAC
message

Hash Function No key — generates fixed length code from message SHA-256,
alone MD5

■■ Key difference: MAC uses a key along with the message. Hash function does NOT use any key.
CHAPTER 3: DIGITAL SIGNATURES & RSA DIGITAL
SIGNATURE

3.1 What is a Digital Signature?


A digital signature is an electronic, encrypted stamp of authentication on digital information such as email
messages or electronic documents. It confirms that the information originated from the signer and has not
been altered during transmission.

■ Digital signature = proof that YOU sent it and nobody changed it. Like a handwritten signature but for
digital documents.

3.2 Why Do We Need Digital Signatures?


• Authentication — proves the message came from a specific sender
• Integrity — proves the message was not tampered with during transmission
• Non-repudiation — sender cannot deny having sent the message later

3.3 Properties of Digital Signatures (Exam Favourite)


Property Meaning

Authenticity The signature must be verifiable by the receiving agent

Unforgeability Nobody else can create a valid signature — only the owner of private key

Non-repudiation Sender cannot deny sending the signed message later

Non-reusability Signature from one document cannot be transferred to another document

3.4 In Blockchain
• Digital signature is a core concept in blockchain
• After each transaction, it is broadcasted to the network
• For this broadcasting, it must be digitally signed by the sender
• This ensures every transaction is authenticated and tamper-proof

3.5 How Digital Signatures Work — Step by Step

Step Sender Side Receiver Side

1 Take the original message Receive message + signature

2 Pass through hash function → get digest Pass received message through same hash → actual digest

3 Encrypt digest with PRIVATE KEY → signature Decrypt signature with sender's PUBLIC KEY → expected digest

4 Send: message + signature together Compare: if expected = actual → VERIFIED ✓

■■ If expected digest = actual digest → signature is valid, message is authentic and untampered. If they
differ → message was modified or signature is forged.
3.6 RSA Digital Signature
RSA Digital Signature uses the RSA algorithm but with the roles of the keys REVERSED compared to
normal RSA encryption.

Operation Normal RSA Encryption RSA Digital Signature

Encryption / Signing Encrypt with PUBLIC key Sign with PRIVATE key

Decryption / Verification Decrypt with PRIVATE key Verify with PUBLIC key

Purpose Confidentiality Authentication + Integrity

Who does it Sender encrypts, receiver decrypts Sender signs, anyone can verify

■ Normal RSA: public key locks, private key opens. RSA Digital Signature: PRIVATE key locks (signs),
PUBLIC key opens (verifies). Opposite!

3.7 RSA Digital Signature — Formulas

Signing (Sender uses PRIVATE key d):


s = m^d mod n

Verification (Receiver uses PUBLIC key e):


m = s^e mod n

If recovered m matches the hash of received message → signature is valid ✓

3.8 RSA Digital Signature — Worked Example


This example from the slides is frequently asked in exams. Know it well.

Parameter Value How calculated

p 17 Given (prime)

q 11 Given (prime)

n 187 n = p × q = 17 × 11

φ(n) 160 φ(n) = (p-1)(q-1) = 16 × 10

e 7 Given (public key component)

d 23 Private key: de ≡ 1 mod φ(n) → 23×7=161=1×160+1

m 88 Message to be signed

Step 1 — Signing:
s = m^d mod n = 88^23 mod 187 = 11

Signed message sent = (88, 11) — original message + signature

Step 2 — Verification:
m = s^e mod n = 11^7 mod 187 = 88 ✓

Recovered value 88 matches original message 88 → Signature is VALID

Step 3 — Forgery Detection:


If attacker sends forged message (88, 13) instead of (88, 11):

13^7 mod 187 = 106 ≠ 88 ✗

106 does not match 88 → Forgery detected! Signature is INVALID

3.9 PYQ Answers — Digital Signatures

■ SHORT ANSWER (2 marks) — Paper D: Explain properties of cryptographic hash


functions
Hash functions have four key properties: (1) One-way — output cannot be reversed to input. (2) Keyless
— no key is used. (3) Fixed output size — always same size regardless of input. (4) Collision resistant —
two inputs never produce same hash. (5) Avalanche effect — tiny input change produces completely
different hash.

■ LONG ANSWER (7 marks) — Paper D: Explain digital signatures and their uses
■ EXAM TIP: Structure: Definition → Why needed → Properties → How it works (steps) → RSA DS
explanation → Uses. Draw the RSA DS process diagram if asked.

A digital signature is an electronic encrypted stamp of authentication on digital information. It confirms the
message originated from the signer and has not been altered. Properties include: Authenticity (verifiable
by receiver), Unforgeability (only private key holder can sign), Non-repudiation (sender cannot deny),
Non-reusability (tied to specific document). In RSA Digital Signature, the sender's private key is used for
signing and public key for verification — opposite of normal RSA. Signing: s = m^d mod n. Verification: m =
s^e mod n. Uses: email authentication, software distribution, blockchain transactions, digital certificates.
CHAPTER 4: SHA-256 (SECURE HASH ALGORITHM)

4.1 What is SHA-256 — Start From Zero


SHA-256 stands for Secure Hash Algorithm — 256 bit. It is one specific way to create a hash (fingerprint)
of any data. No matter what you put in — a single word, a paragraph, or a whole file — you always get
exactly 256 bits (64 hex characters) out.

■ SHA-256 = a specific recipe for making a 256-bit fingerprint of any data. Always 256 bits out. Always
irreversible.

4.2 Key Facts About SHA-256


Fact Value/Explanation

Output size Always 256 bits (64 hex characters)

Input size Less than 2^64 bits (practically unlimited)

Irreversible? Yes — you cannot reverse a SHA-256 hash to get original data

Invented by NSA (National Security Agency), published by NIST

Used in Bitcoin mining, SSL certificates, password hashing, blockchain

Brute force? Practically impossible — 2^256 possible outputs

4.3 SHA-256 — Big Picture Before Steps


Before jumping into steps, understand what SHA-256 does at a high level:

• Takes your message (any size)


• Pads it to make it a multiple of 512 bits
• Breaks it into 512-bit chunks
• Processes each chunk through 64 rounds of mixing
• Produces final 256-bit hash

■■ Think of it like: preparing dough (padding), cutting into equal pieces (chunking), baking each piece (64
rounds of compression), getting final biscuits (256-bit hash).

4.4 SHA-256 Steps — Detailed

STEP 1: PADDING
SHA-256 processes data in blocks of exactly 512 bits. Your message is probably not a multiple of 512 bits.
So we pad (add extra bits) to make it fit.

How padding works:

• After your message, add a single 1 bit


• Then add 0 bits until the total length is 64 bits less than a multiple of 512
• So total after padding = 448 bits, or 960 bits, or 1472 bits etc. (always 64 short of a multiple of 512)
Part Content

Original message Your actual data bits (e.g., "hello" = 40 bits)

Padding start Add 1 bit: 1

Padding fill Add 0s until 64 bits short of multiple of 512

Result after this step Length is 448 bits (or 960, 1472...) — 64 bits short of 512 multiple

■ Padding = stuffing bubble wrap (zeros) after your message until the box (512-bit block) is almost full,
leaving 64 slots empty for step 2.

STEP 2: PADDING LENGTH


Now fill those remaining 64 bits with the length of the ORIGINAL message (before padding). This tells
SHA-256 exactly how long the real message was.

Part Content

Original Message Your data

Padding Bits 1 followed by zeros

Length Value (64 bits) The length of original message in binary

Final Result Total length is now exactly a multiple of 512 bits

■■ After step 2, the data is ready to be hashed. It is now exactly N × 512 bits where N is a whole number.

STEP 3: INITIALISING BUFFERS


Before processing begins, SHA-256 initialises 8 hash values (a through h) and 64 round constants (K[0] to
K[63]). These are fixed, pre-defined values derived from the first 32 bits of the fractional parts of square
roots and cube roots of the first 8 and 64 prime numbers respectively.

Buffer Initial Value (Hex)

a 0x6a09e667

b 0xbb67ae85

c 0x3c6ef372

d 0xa54ff53a

e 0x510e527f

f 0x9b05688c

g 0x1f83d9ab

h 0x5be0cd19

■■ These 8 values + 64 round constants K[0] to K[63] are all mathematically derived and fixed. They do
not change. You do NOT need to memorise these for the exam — just know there are 8 buffers (a to h)
and 64 round keys.

STEP 4: COMPRESSION FUNCTION (64 ROUNDS)


This is the core of SHA-256. Each 512-bit message chunk goes through 64 rounds of mixing with the 8
buffers. Each round uses:

• K[i] — the pre-initialised round constant (fixed)


• W[i] — message schedule word (derived from current message chunk)

The 512-bit message chunk is split into 16 words of 32 bits each (W[0] to W[15]). Then 48 more words
W[16] to W[63] are computed from these. Each round uses one W[i] and one K[i] to update the 8 buffers
using bitwise operations (AND, XOR, ROTR, SHR).

After all 64 rounds, the output of this chunk is added back to the original buffer values. This continues for
each 512-bit chunk. The final values of the 8 buffers (a through h) are concatenated to produce the 256-bit
hash.

Round Input Process Output

Round 1 W[0] + K[0] + 8 buffers 64 bitwise mixing operations Updated 8 buffers

Round 2 W[1] + K[1] + updated buffers 64 bitwise mixing operations Updated 8 buffers

... ... ... ...

Round 64 W[63] + K[63] + buffers 64 bitwise mixing operations Final 8 buffers

Final 8 buffers concatenated a+b+c+d+e+f+g+h 256-bit hash output

4.5 SHA-256 Complete Flow Diagram


ORIGINAL MESSAGE (any size)

STEP 1: ADD PADDING BITS (1 then 0s until 64 bits short of 512 multiple)

STEP 2: ADD LENGTH (64-bit representation of original message length)

PADDED MESSAGE (now exactly multiple of 512 bits)

SPLIT INTO 512-BIT CHUNKS (Chunk 1, Chunk 2, ...)

STEP 3: INITIALISE 8 BUFFERS (a,b,c,d,e,f,g,h) + 64 Round Constants K[0..63]

STEP 4: COMPRESSION — each chunk goes through 64 rounds of mixing

OUTPUT OF EACH CHUNK ADDED BACK TO BUFFERS

AFTER ALL CHUNKS: CONCATENATE 8 BUFFERS

FINAL SHA-256 HASH = 256 BITS (64 hex characters)


4.6 Applications of SHA-256
Application How SHA-256 is Used

Digital Signature Verification Hash of message is signed and verified

Password Hashing Passwords stored as SHA-256 hashes, never plain text

SSL Handshake Certificates verified using SHA-256 during HTTPS connection

Integrity Checks File/data integrity verified by comparing hashes

Bitcoin Mining Miners find a nonce such that SHA-256(block) starts with enough zeros

Blockchain Each block contains SHA-256 hash of previous block — tamper detection

4.7 PYQ Answers — SHA-256

■ LONG ANSWER (7 marks) — Paper A/B/C/D: Explain SHA-256 algorithm with diagram
■ EXAM TIP: Always draw the flow diagram. Examiners give marks for diagram. 4 steps = ~4 marks,
diagram = ~2 marks, applications = ~1 mark.

Answer structure: Define SHA-256 → Key facts (256 bit output, irreversible) → Step 1 Padding → Step 2
Padding Length → Step 3 Initialise Buffers → Step 4 Compression Function → Applications.

SHA-256 is a secure hash algorithm that produces a fixed 256-bit output from any input. It is irreversible
and collision resistant.

Step 1 (Padding): A '1' bit followed by '0' bits is appended until the message length is 64 bits short of a
512 multiple.

Step 2 (Padding Length): The original message length is appended as a 64-bit value, making total length
an exact multiple of 512.
Step 3 (Initialise Buffers): Eight 32-bit hash values (a–h) are initialised with fixed constants. 64 round
constants K[0]–K[63] are stored.

Step 4 (Compression): Each 512-bit chunk goes through 64 rounds. Each round uses a message
schedule word W[i] and round constant K[i] to update the 8 buffers through bitwise operations. After all
chunks, the 8 buffers are concatenated to produce the 256-bit hash.

Applications: Digital signature verification, password hashing, SSL handshake, blockchain integrity,
Bitcoin mining.
CHAPTER 5: MERKLE TREES

5.1 What is a Merkle Tree?


A Merkle Tree is a mathematical data structure composed of hashes of different blocks of data. It serves
as a summary of all transactions in a block and allows for efficient and secure verification of content in a
large body of data.

■ Merkle Tree = a tree of hashes. Leaf nodes = hash of transactions. Every parent = hash of its two
children. Root = fingerprint of ALL transactions.

5.2 Key Facts


• Also known as Binary Hash Tree
• Both Bitcoin and Ethereum use Merkle Trees
• Used to encrypt blockchain data efficiently and securely
• Enables quick and secure content verification across large datasets
• Fundamental part of blockchain technology

5.3 Merkle Tree Structure — Diagram

MERKLE ROOT

Hash(H12, H34)

H(12) H(34)

Hash(H1,H2) Hash(H3,H4)

↑ ↑ ↑

H(1) H(2) H(3) H(4)

hash(T1) hash(T2) hash(T3) hash(T4)

↑ ↑ ↑ ↑

T1 T2 TRANSACTIONS T3 T4

5.4 How Merkle Tree Works


Step Action

1 Each transaction (T1, T2, T3, T4) is individually hashed: H(T1), H(T2), H(T3), H(T4)

2 Pairs of hashes are combined and hashed again: H(T1,T2) and H(T3,T4)

3 These parent hashes are again paired and hashed: this gives the Merkle Root

4 Merkle Root = single hash that represents ALL transactions in the block

5 This Merkle Root is stored in the Block Header

Every leaf node is a hash of transactional data. Every non-leaf node is a hash of its child hashes. The
Merkle Root is the top-most hash that summarises everything.
5.5 Merkle Root in Block Header
The Merkle Root is stored in the block header. The block header contains:

• Hash of the previous block


• Timestamp
• Nonce
• Merkle Root — root hash of all transactions in this block

■■ Having the Merkle Root in the block header makes all transactions tamper-proof. If any single
transaction changes, the leaf hash changes, which changes the parent hash, all the way up to the Merkle
Root — and the block becomes invalid.

5.6 Benefits of Merkle Trees


Benefit Explanation

Data integrity Validates data integrity effectively — any tampering changes the root

Space efficient Takes very little disk space compared to storing all transaction data

Partial verification Can verify a single transaction without downloading the whole block

Fast verification Data integrity check takes only a few moments

Tamper detection Change in any transaction immediately detected through root mismatch

5.7 PYQ Answers — Merkle Trees

■ SHORT ANSWER (2 marks) — Paper C: Benefits of Merkle Trees


Merkle Trees validate data integrity effectively, take up very little disk space, allow partial verification of
individual transactions, and enable fast data integrity checks in just a few moments.

■ LONG ANSWER (7 marks) — Paper A/B: Explain Merkle Tree with diagram + use in
blockchain
■ EXAM TIP: Draw the tree diagram — it's worth easy marks. Label: Transactions at bottom, leaf hashes,
parent hashes, Merkle Root at top. Then explain block header storage.

A Merkle Tree is a binary hash tree fundamental to blockchain technology. Each leaf node contains the
hash of a transaction. Parent nodes contain the hash of their two children. The topmost node is the Merkle
Root — a single hash summarising all transactions. In blockchain: the Merkle Root is stored in the block
header alongside the previous block hash, timestamp and nonce. If any transaction is modified, its hash
changes, propagating changes up to the root, making tampering immediately detectable. Benefits: efficient
data integrity validation, minimal disk space, fast verification, partial transaction verification without full
block download.
CHAPTER 6: DISTRIBUTED HASH TABLES (DHT)

6.1 What is a DHT?


A Distributed Hash Table (DHT) is a decentralized data store based on key-value pairs. Instead of one
central server storing all data, the data is distributed across multiple nodes in a network. Each node is
responsible for a set of keys and their associated values.

■ DHT = a giant shared dictionary spread across thousands of computers. Each computer stores some
keys and their values. No single point of failure.

6.2 Key Concepts


Term Meaning

Key A unique identifier for data — created through a hashing function

Value The actual data — can be any form of data (file, text, etc.)

Node A computer/peer in the distributed network responsible for some keys

Key partitioning Each node stores a scheme to map any key to the correct node

6.3 How DHT Works


Step Action

1 Data is given a key using a hash function (e.g., SHA-256 hash of filename)

2 This key determines which node in the network stores this data

3 Each node stores a key partitioning scheme — a map of which keys go to which nodes

4 When a request comes in for a key, the node checks its partitioning scheme

5 If that node has the data: return it directly

6 If not: forward the request to the correct node that has it

7 Nodes can be added or removed dynamically without breaking the system

6.4 DHT Diagram


DATA → HASH FUNCTION → →
KEY (e.g., DFCD3454) DISTRIBUTED NETWORK (Peers)

"Fox" SHA-256 DFCD3454 Node 3

"The red fox runs..." SHA-256 52ED879E Node 7

"The red fox walks..." SHA-256 46042841 Node 2

6.5 Advantages of DHT


• Decentralized — no single point of failure
• Scalable — nodes can be added or removed easily
• Efficient lookup — provides easy way to find information in large datasets
• Fault tolerant — if one node fails, others continue working
• Used in P2P networks like BitTorrent, IPFS, and blockchain systems

6.6 PYQ Answers — DHT

■ SHORT ANSWER (2 marks) — Paper B: Describe DHT and how it works


A Distributed Hash Table (DHT) is a decentralized data store based on key-value pairs. Each node stores
a key partitioning scheme. When a data request arrives, the node maps the key to the correct node and
forwards the request there. Nodes can be dynamically added or removed.

■ LONG ANSWER (7 marks) — Paper C: Properties of hash functions + DHT working


■ EXAM TIP: Two parts: (a) hash properties — list all 5-6 properties with explanation. (b) DHT —
definition, key-value concept, how lookup works, diagram.

Hash function properties: One-way (irreversible), Keyless (no key needed), Fixed output size,
Deterministic (same input = same output), Avalanche effect (small change = big output change), Collision
resistant. DHT is a decentralized key-value store distributed across network nodes. Each node is
responsible for a set of keys. A hash function converts data to keys. Each node stores a partitioning
scheme to route requests to the correct node. Nodes can be dynamically added/removed. Used in
BitTorrent, IPFS, and blockchain networks for decentralized data storage.
QUICK REFERENCE — ALL TOPICS AT A GLANCE

Topic One Liner Key Formula/Number Exam Focus

y² = x³ + ax + b
ECC RSA but smaller keys, faster, used in crypto Key exchange steps, Cm = {kG, Pm+kPb}
K = nA×PB = nB×PA

of data input → Fixed output


Hash Function One-way fixed-size fingerprintVariable 6 properties: one-way, keyless, fixed, deterministic

Sign: s=m^d mod n


Digital SignatureElectronic proof of who sent it + not tampered 4 properties: authenticity, unforgeability, non-repud
Verify: m=s^e mod n

s=88^23 mod 187=11


RSA Digital SigPrivate key signs, public key verifies — opposite of normal RSA Key role reversal vs normal RSA
Verify: 11^7 mod 187=88

SHA-256 Always 256-bit output, irreversible,


4 steps:
used
pad,
in blockchain
pad length, init buffers,
Steps
64-round
+ flow compression
diagram + applications

Merkle Tree Binary hash tree summarisingLeaf=hash(tx),


all transactionsParent=hash(children),
Structure
Root=Merkle
diagramRoot
+ role in blockchain

DHT Decentralized key-value store Key


across
= hash(data),
network nodes
stored at responsible
How lookup
node works, advantages

PYQ TOPIC MAPPING


Question Paper A Paper B Paper C Paper D

Short Q1 Sym vs Asym Sym vs Asym differences


Sym vs Asym differentiate
Types of keys

Short Q2 Hash in blockchain Describe DHT Benefits of Merkle TreesHash function properties

Long Q11a AES state matrix Hash properties + blockchain


RSA concepts
use AES working

Long Q11b RSA: p=7,q=11,e=17,M=25


RSA: p=3,q=11,e=7,M=5
RSA encryption/decryption
Applications of cryptography

Long Q12a SHA-256 + compressionMerkle Tree with diagram


ECC algorithm Digital signatures + uses

Long Q12b SHA-256 with diagram SHA-256 compression Hash functions → Merkle Trees
Merkle Tree + blockchain

FORMULAS TO REMEMBER
Formula What it is

y² = x³ + ax + b ECC curve equation

PA = nA × G ECC public key generation (A side)

K = nA × PB = nB × PA ECC shared secret key

Cm = {kG, Pm + kPb} ECC encryption

Pm = (Pm + kPb) - nb(kG) ECC decryption

s = m^d mod n RSA Digital Signature — signing

m = s^e mod n RSA Digital Signature — verification

C = M^e mod n RSA normal encryption

M = C^d mod n RSA normal decryption

φ(n) = (p-1)(q-1) RSA Euler totient

n=p×q RSA modulus

You might also like