Blockchain Technolgies
Important Notes
Module 1
Course: Blockchain Technolgies
Course Code: CST428
Name:
APJ Abdul Kalam Technological University
Part A
1. Compare symmetric and asymmetric cryptography. (3 Marks) (June 2023,
October 2023, May 2024, April 2025)
Answer:
Symmetric cryptography and asymmetric cryptography are two important methods used
to protect data in cryptography. Symmetric cryptography uses the same key for encryp-
tion and decryption, while asymmetric cryptography uses two different keys, namely a
public key and a private key.
Symmetric Cryptography Asymmetric Cryptography
It uses a single key for both encryption It uses two keys, namely a public key for
and decryption. encryption or verification and a private
key for decryption or signing.
It is faster because the encryption pro- It is slower because the mathematical
cess is simple and streamlined. operations are more complex.
It is suitable for encrypting large It is usually suitable for small amounts
amounts of data. of data or for secure key exchange.
It mainly provides confidentiality of It provides confidentiality, authenticity,
data. and non-repudiation.
It has a key distribution problem be- It is easier for key distribution because
cause both users must share the same the public key can be shared openly.
secret key securely.
Examples of symmetric cryptography Examples of asymmetric cryptography
are AES and DES. are RSA and DSA.
2. Explain the different types of keys used in cryptography. (3 Marks) (Au-
gust 2024)
Answer:
Different types of keys are used in cryptography based on the type of algorithm and the
purpose of protection.
1
• A secret key or symmetric key is a single shared key that is used for both
encryption and decryption in symmetric cryptography.
• A public key is a key that is openly shared with others and is used in asymmetric
cryptography for encryption or signature verification.
• A private key is a secret key kept only by the owner and is used for decryption or
for creating digital signatures.
• An ephemeral key is a temporary key that is used only for a short period, such
as for a single communication session.
• A static key is a long-term key that is used for a longer duration and is not changed
frequently.
• A master key is a key that is used to generate, protect, encrypt, or decrypt other
keys.
3. Explain properties of cryptographic hash functions. (3 Marks) (August
2024, September 2025)
Answer:
A cryptographic hash function converts an input of any length into a fixed-length digest
and is mainly used to provide data integrity.
• A good hash function can take an input message of any size and produce a fixed-
length output called a digest.
• A good hash function must be easy and fast to compute, even when the input
message is large.
• It must satisfy pre-image resistance, which means it should be practically im-
possible to get the original input back from the hash value.
• It must satisfy second pre-image resistance, which means it should be prac-
tically impossible to find another message that gives the same hash as a given
message.
• It must satisfy collision resistance, which means two different inputs should not
produce the same hash output.
• It should show the avalanche effect, which means even a very small change in the
input should produce a completely different hash value.
2
4. Explain Merkle tree and its role in blockchain security. (3 Marks) (May
2024, September 2025)
Answer:
A Merkle tree is a binary tree made using cryptographic hashes, and it is used to verify
large amounts of data in a secure and efficient way.
• In a Merkle tree, the leaf nodes contain the hashes of transaction data, and the
parent nodes contain the hash of their child nodes.
• This process continues upward until a single final hash called the Merkle root is
obtained.
• In blockchain, the Merkle root helps to verify the integrity of all transactions in a
block without checking every transaction one by one.
• If even a small change happens in any transaction, the hash changes and the Merkle
root also changes, so tampering can be detected quickly.
• Merkle trees are also storage-efficient and bandwidth-efficient because only hashes
need to be stored and checked.
5. Explain distributed hash tables. (3 Marks) (October 2023)
Answer:
A distributed hash table, or DHT, is a distributed system that provides a lookup service
similar to a normal hash table.
• In a normal hash table, data is stored and retrieved using keys, and the key helps
to find the location of the data.
• In a distributed hash table, the same idea is used, but the data is spread across
many nodes in a network instead of being stored in one single table.
• Each node in the network is responsible for storing and managing a part of the
data.
• When a client wants to store or retrieve data, the request is forwarded to the correct
node based on the key of that data.
• DHTs are widely used in peer-to-peer networks, distributed databases, and dis-
tributed file systems.
3
6. Explain digital signatures and their applications. (3 Marks) (April 2025)
Answer:
A digital signature is a cryptographic technique used to prove that a message or document
really came from a particular sender and has not been changed.
• A digital signature is usually created by first calculating the hash of the message
and then signing that hash using the sender’s private key.
• The receiver can verify the signature using the sender’s public key, which gives
assurance about authenticity and integrity.
• Digital signatures also provide non-repudiation, which means the sender cannot
later deny sending the message.
• In blockchain, digital signatures are used to authorize transactions and to prove
ownership of assets.
• Digital signatures are also used in software distribution, email security, digital cer-
tificates, and electronic documents.
7. How can secure hash functions strengthen blockchain technology? (3
Marks) (June 2023)
Answer:
Secure hash functions strengthen blockchain technology by making data verification, block
linking, and tamper detection reliable and efficient.
• A secure hash function such as SHA-256 produces a fixed-length unique-looking
output for every input and works as a one-way function.
• In blockchain, the hash of a block is linked to the next block, which helps in creating
a secure chain of blocks.
• If any transaction or block data is changed, the hash value also changes immediately,
so tampering can be detected easily.
• Secure hash functions are used in proof-of-work mechanisms, where miners search
for a valid hash that satisfies the target condition.
• Secure hash functions are also used in Merkle trees, digital signatures, and blockchain
address generation, which improves the overall security of the system.
4
Part B
1. Explain AES algorithm with steps/rounds and diagram. (8 Marks)
Answer:
Advanced Encryption Standard (AES) is a symmetric key encryption algorithm used to
securely encrypt and decrypt data. It uses the same secret key for both encryption and
decryption. AES is widely used because it is fast, secure, and efficient for encrypting
large amounts of data.
AES works on fixed-size blocks of 128 bits (16 bytes) and supports key sizes of 128 bits,
192 bits, and 256 bits. Based on the key size, AES performs 10, 12, or 14 rounds of
processing respectively.
State Matrix:
In AES, the 128-bit plaintext is arranged into a 4 × 4 matrix of bytes called the state
matrix. All operations in AES are performed on this state matrix throughout the en-
cryption process.
Explanation of Steps:
• AddRoundKey: The state matrix is combined with the round key using XOR
operation.
• SubBytes: Each byte in the state matrix is replaced using a substitution table
(S-box), providing non-linearity.
• ShiftRows: Rows of the state matrix are shifted left by different offsets to provide
diffusion.
• MixColumns: Each column is transformed using matrix multiplication, mixing
the data within columns.
AES Algorithm Steps:
5
1. Input:
• Plaintext (128-bit) and Secret Key (128/192/256 bits)
2. State Formation:
• The 128-bit plaintext (16 bytes) is arranged into a 4 × 4 matrix called
the state matrix
3. Number of Rounds:
• 10 rounds for 128-bit key
• 12 rounds for 192-bit key
• 14 rounds for 256-bit key
4. Round Operations:
Each round consists of the following four steps:
• AddRoundKey:
– The state matrix is XORed with a round key derived from the main
key
• SubBytes:
– Each byte of the state matrix is replaced using a substitution table
(S-box)
• ShiftRows:
– Rows are shifted to the left in a cyclic manner:
∗ Row 1: No shift
∗ Row 2: Shift by 1 byte
∗ Row 3: Shift by 2 bytes
∗ Row 4: Shift by 3 bytes
• MixColumns:
– Columns are mixed using linear transformation
5. Final Round:
• SubBytes
• ShiftRows
• AddRoundKey
• MixColumns is not performed
6. Output:
6
• Final state matrix is converted into ciphertext
7
2. Perform RSA encryption and decryption and explain key generation. (8
Marks)
Answer:
RSA is an asymmetric cryptographic algorithm that uses two keys: a public key for
encryption and a private key for decryption. It is based on the difficulty of factoring
large prime numbers.
Given: p = 7, q = 11, e = 17, M = 25
Step 1: Key Generation
• Compute modulus:
n = p × q = 7 × 11 = 77
• Compute Euler’s Totient:
ϕ(n) = (p − 1)(q − 1) = 6 × 10 = 60
• Public key:
(n, e) = (77, 17)
• Find private key d such that:
d × e ≡ 1 (mod 60)
Finding d:
We need:
17d ≡ 1 (mod 60)
Try values:
17 × 53 = 901
901 mod 60 = 1
∴ d = 53
• Private key:
(n, d) = (77, 53)
Step 2: Encryption
Formula:
C = Me mod n
8
C = 2517 mod 77
Using modular exponentiation:
252 = 625 mod 77 = 9
254 = 92 = 81 mod 77 = 4
258 = 42 = 16
2516 = 162 = 256 mod 77 = 25
2517 = 2516 × 25 = 25 × 25 = 625 mod 77 = 9
∴C=9
Step 3: Decryption
Formula:
M = Cd mod n
M = 953 mod 77
Break exponent: 53 = 32 + 16 + 4 + 1
92 = 81 mod 77 = 4
94 = 42 = 16
98 = 162 = 256 mod 77 = 25
916 = 252 = 625 mod 77 = 9
932 = 92 = 4
Now multiply:
953 = 932 × 916 × 94 × 9
= 4 × 9 × 16 × 9
4 × 9 = 36
36 × 16 = 576 mod 77 = 37
9
37 × 9 = 333 mod 77 = 25
∴ M = 25
Result:
• Ciphertext: C = 9
• Decrypted message: M = 25 (original message recovered)
3. Explain SHA-256 algorithm including its design and compression function
with diagram. (7 Marks)
Answer:
SHA-256 (Secure Hash Algorithm 256) is a cryptographic hash function belonging to the
SHA-2 family. It is widely used in applications such as blockchain (Bitcoin) to ensure
data integrity and security. It produces a fixed-length output of 256 bits for any input
message.
Design of SHA-256:
• Maximum input size: 264 − 1 bits
• Block size: 512 bits
• Word size: 32 bits
• Output: 256-bit hash value
Working of SHA-256:
Pre-processing:
1. Padding: The message is padded so that its length becomes a multiple of 512 bits.
2. Parsing: The padded message is divided into 512-bit blocks.
3. Initialization: Eight initial hash values (H0 , H1 , ..., H7 ) are defined, each of 32
bits.
Hash Computation:
4. Each message block is processed sequentially using 64 rounds. This ensures proper
mixing of the input data.
10
5. Message Schedule: A set of 64 words (W0 , W1 , ..., W63 ) is generated from the
block. This expands the message for use in each round.
6. Initialize Working Variables: Eight variables a, b, c, d, e, f, g, h are initialized
with current hash values. These hold intermediate values during processing.
7. Compression Function:
For each round:
T1 = h + Σ1 (e) + Ch(e, f, g) + Ki + Wi
T2 = Σ0 (a) + M aj(a, b, c)
Update variables:
h = g, g = f, f = e, e = d + T1
d = c, c = b, b = a, a = T1 + T2
This step performs the main transformation and mixing of data.
8. Intermediate Hash Update:
H0 = H0 + a, H1 = H1 + b, ..., H7 = H7 + h
This updates the hash value for the current block.
Final Output:
H0 ||H1 ||H2 ||H3 ||H4 ||H5 ||H6 ||H7
Gives the final 256-bit hash value.
Compression Function Explanation:
• The compression function works on 8 working variables: a, b, c, d, e, f, g, h
• It runs for 64 rounds using constants Ki and message schedule Wi
11
• Two main logical functions are used:
Ch(e, f, g) = (e ∧ f ) ⊕ (¬e ∧ g)
M aj(a, b, c) = (a ∧ b) ⊕ (a ∧ c) ⊕ (b ∧ c)
• Rotation functions:
Σ0 (a) = ROT R2 (a) ⊕ ROT R13 (a) ⊕ ROT R22 (a)
Σ1 (e) = ROT R6 (e) ⊕ ROT R11 (e) ⊕ ROT R25 (e)
4. Explain Merkle tree and its use in blockchain and advantages. (7 Marks)
Answer:
A Merkle tree is a data structure used for secure and efficient verification of large datasets.
It was introduced by Ralph Merkle and is widely used in blockchain technology.
Structure of Merkle Tree:
• A Merkle tree is a binary tree where the leaf nodes contain hashes of transaction
data.
• The hashes of two child nodes are combined and hashed again to form their parent
node.
• This process continues until a single hash value is obtained at the top, called the
Merkle Root.
• The Merkle root represents all transactions in the tree.
12
Working:
• All transactions are first converted into hash values and placed at the leaf nodes.
• Pairwise hashing is performed repeatedly to build upper levels of the tree.
• Any small change in a transaction will change its hash, which propagates upward
and changes the Merkle root.
Use in Blockchain:
• In blockchain, all transactions in a block are organized using a Merkle tree.
• The Merkle root is stored in the block header.
• It allows efficient verification of transactions without downloading the entire block.
Advantages:
• Efficient verification: Only the Merkle root is needed to verify data integrity.
• Tamper detection: Any change in data changes the root hash immediately.
• Storage efficiency: Only hash values are stored instead of full data.
• Bandwidth efficiency: Reduces the amount of data transferred over the network.
13
5. Explain digital signature generation and verification and its uses. (7 Marks)
Answer:
A digital signature is a cryptographic technique used to associate a message with its
sender. It provides authentication, integrity, and non-repudiation.
Digital Signature Generation:
• The sender first computes the hash of the message using a hash function. This
ensures data integrity.
• The hash value is then encrypted using the sender’s private key. This creates the
digital signature.
• The original message along with the digital signature is sent to the receiver.
14
Digital Signature Verification:
• The receiver computes the hash of the received message.
• The receiver decrypts the signature using the sender’s public key. This retrieves
the original hash.
• Both hash values are compared:
– If they match, the message is valid.
– If they do not match, the message is altered.
Properties:
• Authenticity: Confirms the identity of the sender.
• Non-repudiation: Sender cannot deny sending the message.
• Integrity: Ensures the message is not modified.
Uses of Digital Signatures:
• Blockchain Transactions: Digital signatures are used to sign transactions and
prove ownership of assets. They ensure that only the rightful owner can authorize
a transaction.
• Secure Email Systems: Digital signatures are used in email communication to
verify the sender. They ensure that the email is authentic and not altered during
transmission.
• Digital Certificates: Used in SSL/TLS certificates to establish secure connections
over the internet. They help in verifying the identity of websites and preventing
impersonation.
• Software Distribution: Software developers sign applications before distribution.
This ensures that the software is genuine and not tampered with.
• Electronic Documents: Used in signing digital documents such as contracts and
agreements. They provide legal validity and prevent denial of signing.
• E-commerce Transactions: Used to secure online payments and transactions.
They ensure data integrity and authenticity between buyer and seller.
15
6. Explain properties of hash functions and their use and working in blockchain.
(7 Marks)
Answer:
A hash function is a cryptographic function that converts an input of any length into a
fixed-length output called a hash value or digest. It is a keyless function used mainly
to provide data integrity.
Properties of Hash Functions:
• Fixed-length output: Hash functions convert input of any size into a fixed-length
digest. This ensures uniform representation of data.
• Easy to compute: Hash functions are fast and efficient to compute. This allows
quick processing even for large data.
• Pre-image Resistance: Given h(x) = y, it is computationally infeasible to find
x from y. This makes the hash function one-way.
• Second Pre-image Resistance: Given x, it is difficult to find another message
m ̸= x such that h(m) = h(x). This prevents finding alternate inputs with same
hash.
• Collision Resistance: It is difficult to find two different inputs that produce the
same hash value. This ensures uniqueness of hash outputs.
• Avalanche Effect: A small change in input produces a completely different hash
output. This increases security and unpredictability.
Working in Blockchain:
• Each block contains a hash of its data and the hash of the previous block. This
links blocks together to form a chain.
• Transactions are hashed to create a Merkle tree, and the root is stored in the block.
This allows efficient verification of transactions.
• Hash functions are used in mining (Proof of Work) to generate a valid block hash.
Miners repeatedly change nonce values to meet target conditions.
• If any data in a block is changed, its hash changes, breaking the chain. This ensures
tamper detection and immutability.
Uses of Hash Functions:
• Data Integrity in Blockchain: Hash functions are used to verify that data in
16
blocks is not altered. Any small change in data produces a completely different
hash.
• Digital Signatures: Hash functions generate message digests before signing. This
ensures faster processing and integrity of the signed data.
• Password Storage: Passwords are stored as hash values instead of plain text.
This prevents attackers from retrieving original passwords even if data is leaked.
• Message Authentication Codes (MAC): Hash functions are used along with
keys to verify message authenticity. This ensures that the message is from a trusted
source.
• Authentication Systems: Used in login systems to validate user credentials se-
curely. Only hash values are compared instead of actual data.
7. Explain applications of cryptography. (6 Marks)
Answer:
Cryptography is widely used to secure data and communication systems by ensuring
confidentiality, integrity, authentication, and non-repudiation.
Applications of Cryptography:
• Secure Communication: Cryptography is used to protect data transmitted over
networks. It ensures that only authorized users can read the information.
• Data Integrity: Hash functions are used to verify that data has not been modified.
Any change in data can be detected easily.
• Authentication: Cryptographic techniques verify the identity of users and sys-
tems. This ensures that communication occurs between trusted parties.
• Digital Signatures: Used to sign documents and transactions electronically. They
provide authenticity, integrity, and non-repudiation.
• Secure Transactions: Used in online banking, credit/debit card payments, and
e-commerce. It protects financial data from unauthorized access.
• Password Protection: Passwords are stored in encrypted or hashed form. This
prevents exposure of sensitive user credentials.
• Blockchain Technology: Cryptography is used to secure transactions and main-
tain the integrity of the blockchain. It ensures tamper-proof and decentralized sys-
tems.
17
8. Explain Elliptic Curve Cryptography (ECC) algorithm. (10 Marks)
Answer:
1. Logic of Elliptic Curve (2 Marks):
Elliptic Curve Cryptography is based on the mathematical properties of points on an
elliptic curve defined by:
y 2 = x3 + ax + b
where a and b are constants such that:
4a3 + 27b2 ̸= 0
ECC uses point multiplication:
Q = kP
where P is a point on the curve, k is a private key, and Q is the public key. It is easy to
compute Q from kP , but difficult to find k from Q.
2. ECC Key Exchange (3 Marks):
• Select elliptic curve parameters and a base point G
18
• User A selects private key dA and computes public key:
QA = dA G
• User B selects private key dB and computes public key:
QB = dB G
• Shared secret key:
S = dA QB = dB QA
Both users obtain the same secret key without sharing private keys.
3. ECC Encryption (2 Marks):
• Represent message as a point M on the curve
• Choose random integer k
• Compute:
C1 = kG
C2 = M + kQ
• Ciphertext is (C1 , C2 )
4. ECC Decryption (2 Marks):
• Receiver uses private key d
• Compute:
M = C2 − dC1
This recovers the original message point.
5. Advantages (1 Mark):
• Provides high security with smaller key size
• Faster computations and efficient performance
• Widely used in blockchain and digital signatures
19