100% found this document useful (1 vote)
11 views12 pages

Basic Crypto Primitives Explained

Unit II covers basic cryptographic primitives essential for blockchain technology, including cryptographic hash functions, digital signatures, public key cryptography, and Merkle trees. These elements ensure data integrity, security, and efficient verification in cryptocurrency transactions. The document highlights their applications and importance in modern cybersecurity and decentralized finance.

Uploaded by

arjitkumaar04
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
100% found this document useful (1 vote)
11 views12 pages

Basic Crypto Primitives Explained

Unit II covers basic cryptographic primitives essential for blockchain technology, including cryptographic hash functions, digital signatures, public key cryptography, and Merkle trees. These elements ensure data integrity, security, and efficient verification in cryptocurrency transactions. The document highlights their applications and importance in modern cybersecurity and decentralized finance.

Uploaded by

arjitkumaar04
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

Unit II: Basic Crypto Primitives

Unit II: Basic Crypto Primitives

1. Cryptographic Hash Function:


A cryptographic hash function is a mathematical algorithm that transforms input data of
arbitrary size into a fixed-size output, often called a hash value or digest. These functions
are fundamental in blockchain as they ensure data integrity and authenticity. A small
change in the input leads to a completely different hash output, a property known as the
avalanche effect.

2. Properties of a Hash Function:


- Deterministic: The same input will always produce the same output.
- Fast Computation: Hashing should be computationally efficient.
- Pre-image Resistance: It should be infeasible to reverse the process and retrieve the
original input from its hash value.
- Collision Resistance: Two different inputs should not produce the same output.
- Avalanche Effect: A slight change in input drastically changes the output.

3. Hash Pointer and Merkle Tree:


- Hash Pointer: A hash pointer not only points to the location of data but also stores the
cryptographic hash of that data. This ensures data integrity.
- Merkle Tree: A binary tree structure in which each non-leaf node is a hash of its child
nodes. It allows efficient and secure verification of large data sets, widely used in blockchain
for transaction verification.

4. Digital Signature:
A digital signature is a cryptographic technique that ensures data authenticity, integrity, and
non-repudiation. It uses a pair of keys—private and public. The sender signs the data using
the private key, and the receiver verifies it using the corresponding public key.

5. Public Key Cryptography:


Public Key Cryptography, also known as asymmetric cryptography, involves two keys: a
public key and a private key. The public key is shared openly, while the private key is kept
secret. It is widely used in blockchain for secure transactions and communication.

6. A Basic Cryptocurrency:
Cryptocurrency is a digital form of money that uses cryptography for security. It is
decentralized and operates on blockchain technology. Examples include Bitcoin and
Ethereum. Basic cryptocurrency functions include:
- Enabling peer-to-peer transactions without intermediaries.
- Using cryptographic techniques for security and validation.
- Preventing double-spending using distributed consensus mechanisms.

Conclusion:
Basic crypto primitives such as hash functions, digital signatures, public key cryptography,
and Merkle trees form the foundation of blockchain technology. These primitives ensure
security, transparency, and reliability in cryptocurrency transactions and other blockchain
applications.
Cryptographic Hash Functions

Introduction:
A cryptographic hash function is a special class of hash functions that is designed to provide
security by generating a fixed-size output (hash value) from an arbitrary length input. Hash
functions are widely used in cryptography, blockchain, digital signatures, and data integrity
verification.

Definition:
A cryptographic hash function H takes an input (or 'message') of any length and returns a
fixed-size string, which is typically a sequence of numbers and letters. The output is often
called the hash value or message digest.

Key Properties of Cryptographic Hash Functions:


1. Determinism: For a given input, the hash function always produces the same output.
2. Fast Computation: The function should be able to compute the hash quickly, even for
large data inputs.
3. Pre-image Resistance: Given a hash output h, it should be computationally infeasible to
find any input x such that H(x) = h.
4. Second Pre-image Resistance: Given an input x1, it should be hard to find another input
x2 such that H(x1) = H(x2).
5. Collision Resistance: It should be infeasible to find two different inputs x1 and x2 such
that H(x1) = H(x2).
6. Avalanche Effect: A small change in the input should cause a drastic change in the output
hash.

Examples of Cryptographic Hash Functions:


1. MD5 (Message Digest 5) – Produces a 128-bit hash value. It is fast but no longer secure
due to vulnerabilities.
2. SHA-1 (Secure Hash Algorithm 1) – Produces a 160-bit hash value, also considered
insecure today.
3. SHA-2 Family (SHA-224, SHA-256, SHA-384, SHA-512) – Stronger algorithms widely used
in security applications.
4. SHA-3 – The latest member of the Secure Hash Algorithm family, designed to resist
advanced cryptographic attacks.

Applications of Cryptographic Hash Functions:


1. Data Integrity: Used to verify that data has not been altered.
2. Digital Signatures: Ensures authenticity and non-repudiation of data.
3. Password Storage: Passwords are stored as hash values instead of plain text.
4. Blockchain: Used to link blocks securely, ensuring immutability of the ledger.
5. Message Authentication Codes (MAC): Provides message integrity and authentication.

Conclusion:
Cryptographic hash functions are fundamental to modern cryptography and cybersecurity.
Their unique properties such as collision resistance, pre-image resistance, and avalanche
effect make them essential for blockchain, secure communications, authentication, and data
protection.
Hash Pointers and Merkle Tree

Introduction:
Hash pointers and Merkle trees are fundamental cryptographic data structures used in
blockchain technology to ensure data integrity, security, and efficient verification. They
form the backbone of how data is linked, validated, and protected in distributed systems
like Bitcoin and Ethereum.

1. Hash Pointers:
- A hash pointer is similar to a regular pointer but instead of just storing the address of the
data, it also stores the cryptographic hash of the data located at that address.
- This provides two functionalities:
a) It tells where the data is stored (address).
b) It provides a way to verify that the data has not been tampered with (hash).

Features of Hash Pointers:


- Data Integrity: Any modification in the data will change the hash, making tampering
detectable.
- Linking Data: They allow creation of tamper-evident linked data structures such as
blockchains and linked lists.
- Security: Enhances trust in distributed environments by providing verifiable pointers.

Use in Blockchain:
- Each block in a blockchain stores a hash pointer to the previous block. This ensures
immutability and provides a secure chain of blocks.

2. Merkle Tree:
- A Merkle tree (or hash tree) is a binary tree where each leaf node is a hash of a data block,
and each non-leaf node is a hash of the concatenation of its child nodes.
- At the top of the Merkle tree is the Merkle root, which summarizes all transactions in the
block.

Properties of Merkle Tree:


- Efficient Verification: Allows verification of data without storing the entire dataset.
- Tamper Detection: Any change in a transaction will change the corresponding leaf node
hash, which will propagate up to the Merkle root.
- Scalability: Provides efficient proof of inclusion called Merkle proofs, reducing storage and
computational requirements.

Applications in Blockchain:
- Transaction Verification: Used in Bitcoin and other cryptocurrencies to verify whether a
transaction belongs to a block without downloading the entire block (SPV – Simplified
Payment Verification).
- Data Integrity: Ensures that all transactions within a block are unchanged and secure.
- Lightweight Clients: Allows mobile wallets and clients to interact with the blockchain
securely with minimal data.

Conclusion:
Hash pointers and Merkle trees play a critical role in blockchain security and efficiency.
Hash pointers ensure immutability of data in the chain, while Merkle trees enable efficient
transaction verification and data integrity checks. Together, they provide the cryptographic
backbone that makes blockchain a secure and trustworthy technology.
Digital Signature - Detailed Notes

1. Introduction
A Digital Signature is a mathematical scheme for verifying the authenticity and integrity of
digital data. It is the digital equivalent of a handwritten signature or a stamped seal but
much more secure. Digital signatures are widely used in securing communication, software
distribution, and financial transactions.

2. Working of Digital Signature


Digital signatures work on the principles of public key cryptography (asymmetric
cryptography). A key pair (public key and private key) is used in this process:
1. Sender generates a hash of the message.
2. The hash is encrypted using the sender’s private key (this becomes the digital signature).
3. The receiver decrypts the signature using the sender’s public key to obtain the hash.
4. The receiver also generates a hash of the received message.
5. If both hashes match, the message is verified and authentic.

3. Features of Digital Signatures


1. Authentication: Ensures the sender is genuine.
2. Integrity: Ensures the message has not been altered.
3. Non-repudiation: The sender cannot deny sending the message.
4. Security: Provides resistance against forgery and tampering.

4. Algorithms Used in Digital Signatures


Several algorithms are commonly used for generating and verifying digital signatures:
- RSA (Rivest–Shamir–Adleman)
- DSA (Digital Signature Algorithm)
- ECDSA (Elliptic Curve Digital Signature Algorithm)
- EdDSA (Edwards-curve Digital Signature Algorithm)

5. Applications of Digital Signatures


1. Secure Email Communication
2. Software Distribution and Updates
3. Digital Certificates and SSL/TLS
4. Financial Transactions
5. Legal and Government Documents

6. Advantages and Disadvantages

Advantages:
- Provides strong security and trust.
- Saves time and cost in business processes.
- Legally recognized in many countries.
- Prevents forgery and unauthorized access.

Disadvantages:
- Requires infrastructure like PKI (Public Key Infrastructure).
- Complexity in implementation.
- Dependency on certificate authorities.
- If private key is compromised, security is lost.

7. Conclusion
Digital signatures are a cornerstone of modern cybersecurity. They provide authenticity,
integrity, and non-repudiation in digital communications and transactions. With the rise of
e-commerce, e-governance, and digital payments, digital signatures are becoming
increasingly important in ensuring trust and security.
Public Key Cryptography - Detailed Notes

1. Introduction
Public Key Cryptography, also known as Asymmetric Cryptography, is a cryptographic
system that uses two separate keys: a public key, which can be shared with everyone, and a
private key, which is kept secret. This system enables secure communication,
authentication, and digital signatures over insecure channels.

2. Working Principle
The fundamental concept behind public key cryptography is the use of key pairs:
1. Each user generates a key pair: a public key and a private key.
2. The public key is shared openly, while the private key is kept secret.
3. If a sender wants to send a secure message, they encrypt it using the recipient’s public
key.
4. Only the recipient’s private key can decrypt the message.
5. For authentication, a sender can sign a message using their private key, and anyone can
verify it with their public key.

3. Features of Public Key Cryptography


1. Uses two keys: public and private.
2. Provides encryption, decryption, and authentication.
3. Offers non-repudiation through digital signatures.
4. Based on mathematical problems like factorization or discrete logarithms.
5. Enables secure key exchange over insecure channels.

4. Common Algorithms
Several algorithms are widely used in public key cryptography:
- RSA (Rivest–Shamir–Adleman): Based on the difficulty of factoring large prime numbers.
- DSA (Digital Signature Algorithm): Used for digital signatures.
- ECC (Elliptic Curve Cryptography): Provides strong security with smaller keys.
- Diffie-Hellman Key Exchange: Used for securely exchanging cryptographic keys.
- ElGamal Encryption: Based on discrete logarithms.

5. Applications of Public Key Cryptography


1. Secure Communication (e.g., emails, messaging)
2. Digital Signatures and Authentication
3. SSL/TLS for secure web browsing
4. Cryptocurrencies and Blockchain
5. Secure Key Exchange
6. Protecting sensitive data in cloud and IoT environments
6. Advantages and Disadvantages

Advantages:
- Eliminates the need to share secret keys directly.
- Provides authentication and confidentiality.
- Supports digital signatures and non-repudiation.
- Enables secure communication over untrusted networks.

Disadvantages:
- Slower than symmetric cryptography due to complex mathematics.
- Requires more computational resources.
- Public Key Infrastructure (PKI) is needed for large-scale implementation.
- Vulnerable if private key is compromised.

7. Conclusion
Public Key Cryptography revolutionized secure digital communication by enabling
encryption, authentication, and digital signatures without the need to share secret keys.
Despite its computational overhead, it remains the backbone of modern cybersecurity,
playing a vital role in internet security, e-commerce, and blockchain technology.
Cryptocurrency - Basic Detailed Notes

1. Introduction
Cryptocurrency is a type of digital or virtual currency that uses cryptography for security. It
operates on decentralized networks based on blockchain technology. Unlike traditional
currencies issued by governments, cryptocurrencies are not controlled by any central
authority, making them resistant to government interference or manipulation.

2. Key Features of Cryptocurrency


1. Decentralization: Managed on distributed networks using blockchain.
2. Security: Uses cryptographic algorithms to ensure secure transactions.
3. Transparency: Transactions are recorded on a public ledger (blockchain).
4. Anonymity: Users can transact without revealing personal details.
5. Limited Supply: Most cryptocurrencies have a capped supply (e.g., Bitcoin has 21 million
coins).

3. How Cryptocurrency Works


1. Transactions are initiated by users and digitally signed using private keys.
2. These transactions are broadcast to a peer-to-peer network.
3. Miners/validators verify transactions and add them into a block.
4. Blocks are linked together in chronological order, forming a blockchain.
5. The verified transaction becomes a permanent record on the blockchain.

4. Popular Cryptocurrencies
- Bitcoin (BTC): The first and most popular cryptocurrency, launched in 2009.
- Ethereum (ETH): Known for smart contracts and decentralized applications (DApps).
- Ripple (XRP): Focuses on fast and low-cost international payments.
- Litecoin (LTC): A peer-to-peer cryptocurrency with faster block generation time.
- Dogecoin (DOGE): Initially created as a meme, now widely used for tipping and donations.

5. Applications of Cryptocurrency
1. Digital Payments
2. Investment and Trading
3. Smart Contracts and Decentralized Applications
4. International Money Transfers
5. Blockchain-based Services (supply chain, healthcare, voting systems)

6. Advantages and Disadvantages

Advantages:
- Provides secure, transparent, and decentralized transactions.
- Enables fast international money transfers.
- Reduces dependency on banks and intermediaries.
- High potential for investment returns.

Disadvantages:
- High price volatility and investment risks.
- Lack of regulation in many countries.
- Vulnerable to hacking and scams.
- Limited acceptance as a payment method.
- Requires technical knowledge for safe use.

7. Conclusion
Cryptocurrency represents a revolutionary change in the financial world, offering
decentralization, transparency, and security. While it provides numerous opportunities in
digital payments, investments, and blockchain innovations, it also faces challenges like
volatility, regulation, and security risks. With growing adoption, cryptocurrencies are likely
to play a major role in the future of global finance.

You might also like