0% found this document useful (0 votes)
4 views

Unit-1 Introduction to BlockChain Technology

The document provides an overview of blockchain technology and cryptography, covering key concepts such as encryption, digital signatures, and the history of blockchain development. It explains the importance of cryptographic techniques in securing information and facilitating decentralized transactions without intermediaries. Additionally, it highlights the evolution of blockchain from its inception to its current applications in cryptocurrencies and beyond.

Uploaded by

sinistersix61
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Unit-1 Introduction to BlockChain Technology

The document provides an overview of blockchain technology and cryptography, covering key concepts such as encryption, digital signatures, and the history of blockchain development. It explains the importance of cryptographic techniques in securing information and facilitating decentralized transactions without intermediaries. Additionally, it highlights the evolution of blockchain from its inception to its current applications in cryptocurrencies and beyond.

Uploaded by

sinistersix61
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 105

Unit-1

Block-Chain Technology
By
Mr. Nitish Patidar
Syllabus
• Introduction and crypto foundation: Elliptic
curve Cryptography
• ECDSA
• Encryption and decryption.
• Introduction to Block-chain Technology with
its Applications, Block-chain Network,
• Hashing Algorithm: SHA-256
• Immutable Ledger
• Centralized and Distributed P2P Network.
Cryptography
• Cryptography is technique of securing information and
communications through use of codes so that only those person
for whom the information is intended can understand it and
process it.
• As a result preventing unauthorized access to information.
• Cryptography uses mathematical techniques to transform data
and prevent it from being read or tampered with by
unauthorized parties.
• The prefix “crypt” means “hidden” and suffix “graphy” means
“writing”.
• It converting intelligible text into unintelligible text, and vice
versa. Cryptographic techniques allow only a message’s sender
and intended recipient to read the decoded contents.
• Techniques used For Cryptography: In today’s age of computers
cryptography is often associated with the process where an ordinary
plain text is converted to cipher text which is the text made such that
intended receiver of the text can only decode it and hence this process
is known as encryption.
• The process of conversion of cipher text to plain text this is known as
decryption.
“There are Two types of encryption”
• Symmetric-key Encryption (secret key
encryption): Symmetric-key algorithms are
cryptographic algorithms that employ the same
cryptographic keys both for plain-text encryption and
cipher-text decoding. The keys could be identical, or
there could be a simple transition between them.
• Asymmetric-key encryption (public key
encryption): Asymmetric-key algorithms encrypt and
decrypt a message using a pair of related keys (one
public key and one private key) and safeguard it from
unauthorized access or usage.
Some Terminology
• Public key– Key which is known to everyone. Ex-public key of A
is 7, this information is known to everyone.
• Private key– Key which is only known to the person who’s
private key it is.
• Authentication-Authentication is any process by which a system
verifies the identity of a user who wishes to access it.
• Non- repudiation– Non-repudiation is a way to guarantee that the
sender of a message cannot later deny having sent the message
and that the recipient cannot deny having received the message.
• Integrity– to ensure that the message was not altered during the
transmission.
• Message digest -The representation of text in the form of a single
string of digits, created using a formula called a one way hash
function. Encrypting a message digest with a private key creates a
digital signature which is an electronic means of authentication.
Types of Cryptography
• Here are the different types of cryptography:
• Secret Key Cryptography: Secret-key cryptography is also
called symmetric cryptography because the same key is used to both
encrypt and decrypt the data.
• Well-known secret-key cryptographic algorithms include Advanced
Encryption Standard (AES),
• Triple Data Encryption Standard (3DES), and
• Rivest Cipher 4 (RC4).
Public Key Cryptography
• The sender uses a public key to encrypt the message, and
the receiver uses a private key to decrypt it. If the
message is intercepted, the contents can’t be deciphered
without the private key.
Digital Signature
• A digital signature is a cryptographic
technique used to verify the authenticity and
integrity of digital messages or documents.
• It provides a way to ensure that a message or
document has not been altered during transit
and that it was definitely created by the
claimed sender.
Here's how digital signatures typically
work
• Hashing: The content of the message or document is first passed through
a hash function to generate a fixed-size string of characters, often referred
to as a hash value or digest. This hash value is unique to the content of
the message.
• Private Key Encryption: The hash value is then encrypted with the
sender's private key. The private key is a part of a key pair (along with a
corresponding public key), and it is kept secret by the owner.
• Digital Signature: The encrypted hash value, along with other
information such as the public key of the sender, forms the digital
signature. This signature is attached to the original message or document.
• Verification: To verify the digital signature, the recipient uses the
sender's public key to decrypt the encrypted hash value. This produces a
hash value that should match the one generated from the received
message. If the two hash values match, the signature is considered valid,
and the message or document is deemed authentic and unaltered.
Digital Signature
Benefits
• Authentication: The recipient can be
confident about the identity of the sender.
• Integrity: Any modification of the message or
document, intentional or accidental, can be
detected.
• Non-repudiation: The sender cannot later
deny having sent the message, as their private
key is used to create the digital signature.
Hash Functions
• Hash functions don’t rely on keys.
• Instead, they scramble data of varying size
into values of uniform length.
• A hash function is a mathematical function
that converts a numerical input value into
another compressed numerical value. The
input to the hash function is of arbitrary
length but output is always of fixed length.
• Values returned by a hash function are
called message digest or simply hash
values.
• With hash functions, both a one-word
message and a 1000-page novel create a
fixed-sized output of encoded text (called a
hash value), making it nearly impossible to
determine the original content. Commonly
using the MD5 hashing algorithm, hashing is
often used for authentication purposes.
A peer-to-peer (P2P) network
• A Peer-to-Peer (P2P) network is created when
two or more PCs are connected and share
resources without going through a separate
server computer.
• A P2P network can be a couple of computers
connected via a Universal Serial Bus to
transfer files.
Cryptocurrency
• A Crypto-Currency, crypto-currency, or crypto is
a digital currency designed to work as a medium
of exchange through a Computer network that is
not reliant on any central authority, such as
a government or bank, to uphold or maintain it.
• It is a decentralized system for verifying that the
parties to a transaction have the money they claim
to have, eliminating the need for traditional
intermediaries, such as banks, when funds are
being transferred between two entities.
Crypto-currency
• Crypto-currency is a digital payment system that doesn't rely on
banks to verify transactions.
• It’s a peer-to-peer system that can enable anyone anywhere to
send and receive payments.
• Instead of being physical money carried around and exchanged
in the real world, crypto currency payments exist purely as
digital entries to an online database describing specific
transactions.
• When you transfer Crypto-currency funds, the transactions are
recorded in a public ledger.
• Crypto-currency is stored in digital wallets.
• Crypto-currency received its name because it uses encryption to
verify transactions.
• This means advanced coding is involved in storing and
transmitting Crypto-currency data between wallets and to public
Example of Cryptocurrency
• Bitcoin
• Ethereum
• Tether
• XRP
• Bitcoin cash
• Bitcoin SV
• Litecoin
• Binance Coin
• EOSA
• Tezos
What is Block chain?
– A Linked List
– Replicated
– Distributed
– Consistency maintained by Consensus
– Cryptographically linked
– Cryptographically assured integrity of data
– Used as
– Immutable Ledger of events, transactions or time stamped data
– Tamper resistant log
– Platform to Create and Transact in Crypto-currency
– log of events/transactions unrelated to currency
Imagine four friends Jack, Ted, Sam and Phil meet up
for dinner after they're done Jack pays the bill and all of
them decide to split the expense amongst each other.
To Solve this problems
Block-chain Technology Definitions
• Blockchain is a method of recording information that makes it
impossible or difficult for the system to be changed, hacked, or
manipulated.

• A blockchain is a distributed ledger that duplicates and


distributes transactions across the network of computers
participating in the blockchain.

• Blockchain technology is a structure that stores transactional


records, also known as the block, of the public in several
databases, known as the “chain,” in a network connected
through peer-to-peer nodes. Typically, this storage is referred to
as a ‘digital ledger.’
Block-chain Technology

• Every transaction in this ledger is authorized by


the digital signature of the owner, which
authenticates the transaction and safeguards it
from tampering.
• Hence, the information the digital ledger contains is
highly secure.
• In simpler words, the digital ledger is like a Google
spreadsheet shared among numerous computers in
a network, in which, the transactional records are
stored based on actual purchases.
• The interesting angle is that anybody can see the
data, but they can’t corrupt it.
Advantages
• Highly Secure
– It uses a digital signature feature to conduct fraud-free
transactions making it impossible to corrupt or change the data
of an individual by the other users without a specific digital
signature.
• Decentralized System
– Conventionally, you need the approval of regulatory authorities
like a government or bank for transactions; however, with Block-
chain, transactions are done with the mutual
consensus(agreement) of users resulting in smoother, safer, and
faster transactions.
• Automation Capability
– It is programmable and can generate systematic actions, events,
and payments automatically when the criteria of the trigger are
Blocks
• A block in a block chain is a combination of
three main components:
– The header contains metadata such as a timestamp
which has a random number used in the mining
process and the previous block's hash.
– The data section contains the main and actual
information like transactions and smart contracts
which are stored in the block.
– Lastly, the hash is a unique cryptographic value
that works as a representative of the entire block
which is used for verification purposes.
Block Chain Working
Block Chain Working
History of Block-chain
• 1991: In 1991, researcher scientists named Stuart Haber and W.
Scott Stornetta introduce Blockchain Technology. These scientists
wanted some Computational practical Solution for time-stamping
the digital documents so that they couldn’t be tempered or
misdated. So both scientists together developed a system with the
help of Cryptography. In this System, the time-stamped
documents are stored in a Chain of Blocks.
• 1992: After that in 1992, Merkle Trees formed a legal corporation
by using a system developed by Stuart Haber and W. Scott
Stornetta with some more features. Hence, Blockchain
Technology became efficient to store several documents to be
collected into one block. Merkle used a Secured Chain of Blocks
that stores multiple data records in a sequence. However, this
technology became unused when the Patent came into existence in
2004.
History of Block-chain
• 2000: In the year 2000, Stefan Konst published his theory of
cryptographic secured chains, plus ideas for implementation.
• 2004: In the year 2004, Cryptographic activist Hal Finney
introduced a system for digital cash known as “Reusable Proof of
Work”. This step was the game-changer in the history of
Blockchain and Cryptography. This System helps others to solve
the Double Spending Problem by keeping the ownership of
tokens registered on a trusted server.
• 2008: After that 2008, Satoshi Nakamoto conceptualized the
concept of “Distributed Blockchain” in his white paper: ”A
Peer to Peer Electronic Cash System”. He modified the model
of Merkle Tree and created a system that is more secure and
contains the secure history of data exchange. His System follows
a peer-to-peer network of time stamping. His system became so
useful that Cryptography became the backbone of Block-chain.
History of Block-chain
• 2009: After that, the evolution of Blockchain is steady and promising and
became a need in various fields. In 2009, Satoshi Nakamoto Releases Bitcoin
White Paper.
• Blockchain technology is so secure that the following surprising news will give
proof of that. A person named, James Howells was an IT worker in the United
Kingdom, he starts mining bitcoins which are part of Blockchain in 2009 and
stopped this in 2013. He spends $17,000 on it and after he stopped he sells the
parts of his laptop on eBay and keep the drive with him so that when he needs
to work again on bitcoin he will utilize it but while cleaning his house in 2013,
he thrashed his drive with garbage and now his bitcoins cost nearly $127
million. This money now remains unclaimed in the Bitcoin system.
• 2014: The year 2014 is marked as the turning point for blockchain technology.
Blockchain technology is separated from the currency and Blockchain 2.0 is
born. Financial institutions and other industries started shifting their focus from
digital currency to the development of blockchain technologies.
• 2015: In 2015, Ethereum Frontier Network was launched, thus enabling
developers to write smart contracts and dApps that could be deployed to a live
network. In the same year, the Linux Foundation launched the Hyperledger
project.
History of Block-chain
• 2016: The word Blockchain is accepted as a single word instead of two different
concepts as they were in Nakamoto’s original paper. The same year, a bug in the
Ethereum DAO code was exploited resulting in a hard fork of the Ethereum
Network. The Bitfinex bitcoin exchange was hacked resulting in 120,000 bitcoin
being stolen.
• 2017: In the year 2017, Japan recognized Bitcoin as a legal currency. Block.one
company introduced the EOS blockchain operating system which was designed to
support commercial decentralized applications.
• 2018: Bitcoin turned 10 in the year 2018. The bitcoin value continued to drop,
reaching the value of $3,800 at the end of the year. Online platforms like Google,
Twitter, and Facebook banned the advertising of cryptocurrencies.
• 2019: In the year 2019, Ethereum network transactions exceeded 1 million per day.
Amazon announced the general availability of the Amazon Managed Blockchain
service on AWS.
• 2020: Stablecoins were in demand as they promised more stability than traditional
cryptocurrencies. The same year Ethereum launched Beacon Chain in preparation
for Ethereum 2.0.
• 2022 : Ethereum has shifted from Proof of Work(PoW) to Proof of Stake(PoS)
consensus mechanism. The original Ethereum mainnet merged with Beacon Chain
which has Proof-of-Stake. Now it is existing as one chain. Ethereum’s energy
Numerical representation of a Message
• The numerical representation of a message is often created by converting the characters
in the message into their corresponding ASCII or Unicode values. Each character is
assigned a unique numerical code, allowing it to be represented as an integer.
• Here's a simple example using ASCII values:
• ASCII Representation:
– ASCII is a character encoding standard where each character is assigned a unique numeric code.
– For example, the ASCII code for the letter 'A' is 65, 'B' is 66, and so on.
• Numerical Representation of a Message:
– To convert a message into numerical representation, you can convert each character to its ASCII
value.
– Concatenate these ASCII values to represent the entire message as a sequence of numbers.
• Example:
• Message: "HELLO"
• ASCII values: H(72) + E(69) + L(76) + L(76) + O(79)
• Numerical representation: 7269767679
• In practice, encoding standards like UTF-8 may be used for more comprehensive
character support, but the basic idea of converting characters to numerical values
remains the same. The encode method in many programming languages is often used to
perform such conversions.
Elliptic Curve Cryptography
• Bitcoin uses a digital signature system called ECDSA to control the ownership
of bitcoins.
• In short, a digital signature system allows you to generate your
own private/public key pair, and use the private key to generate digital
signatures that proves you are the owner of the public key without having to
reveal the private key.
Elliptic Curve Cryptography
• This system is used in Bitcoin to allow people to receive and
send bitcoins.
• Anyone can generate their own pair of keys, and then anyone
can send (or “lock”) bitcoins to your public key.
• Nobody can steal these bitcoins, because only the person
with the correct private key for this public key is able to
generate valid signatures to “unlock” the bitcoins and send
them to someone else.
• The ability to create digital signatures has been around since
the 1970s thanks to the invention of RSA. In 1994, DSA was
released as the standard for digital signature systems.
• ECDSA is just an implementation of DSA using elliptic
curve cryptography, as the mathematics of elliptic curves
Elliptic Curve Cryptography
• Elliptic curve cryptography (ECC) is an approach to public-key
cryptography based on the algebraic structure of elliptic curves
over finite fields Fn and the complexity of the elliptic curves
discrete logarithm problem.
• ECC implements all major capabilities of the asymmetric
cryptosystems: encryption, signatures and key exchange.
• Elliptic curves belong to very important and deep mathematical
concepts with a very broad use.
• The use of elliptic curves for cryptography was suggested,
independently, by Neal Koblitz and Victor Miller in 1985.
• Both bitcoin and Ethereum use ECC-based algorithms for their
encryption needs.
• ECC started to be widely used after 2005.
• Currently Bitcoin uses secp256k1 (Standards for Efficient
Elliptic Curve Cryptography
• Elliptical curve cryptography (ECC) is a public key encryption
technique based on elliptic curve theory that can be used to create
faster, smaller and more efficient cryptographic keys.
• The private keys in the ECC are integers (in the range
of the curve's field size, typically 256-bit integers).
Example of 256-bit ECC private key (hex encoded, 32
bytes, 64 hex digits) is:
0x51897b64e85c3f714bba707e867914295a1377a7463a9dae8ea6a8b914246
319
• The key generation in the ECC cryptography is as
simple as securely generating a random integer in
certain range, so it is extremely fast. Any number within
For example, the NIST curve secp256k1 (used in Bitcoin) is
based on an elliptic curve in the form:
y2 = x3 + 7 (the above elliptic curve equation,
where a = 0 and b = 7)
Elliptic Curve Cryptography
• An elliptic curve is a plane
curve defined by an equation
of the form:
• y2 = x3 + ax + b
• ECC is a powerful
cryptography approach. It
generates security between
key pairs for public key
encryption by using the
mathematics of elliptic curves.
Elliptic Curve Cryptography
• (where a, b are either rational numbers or integers (and
computation is done modulo some integer n)) extended by a
“point at infinity”, denoted usually as ∞ (or 0) that can be
regarded as being, at the same time, at the very top and very
bottom of the y-axis.
• We will consider only those elliptic curves that have no
multiple roots - which is equivalent to the condition
• 4a3 + 27b2 ≠ 0.
• In case coefficients and x, y can be any rational numbers, a
graph of an elliptic curve has one of the forms shown in the
following figure.
• The graph depends on whether the polynomial x 3 + ax + b has
three or only one real root.
Point addition: Given that two points are provided on the curve,
we draw a straight line passing through those points. The point
where that straight line intersects the curve for the 3rd and the final
time is mirrored horizontally to get the next point.
Point doubling: When only one point is provided, a straight line
can not be drawn, so we draw a tangent at the point provided. The
point where that tangent intersects the curve again is mirrored
horizontally to get another point.
ECC Key Length
• ECC Key Length (bit)
160
224
256
384
521
Benefits of Elliptic Curve Cryptography

• The fact that ECC provides a very high level of security


with short key lengths gives it advantages over RSA and
other public-key cryptography algorithms.
• Here are two benefits of using elliptic curve
cryptography.
– ECC requires fewer computational resources and less
bandwidth for key generation, encryption and decryption.
– Due to ECC’s smaller key size, ECC operations, such as key
generation, encryption and decryption, can be performed faster
compared to RSA, which means less latency for the end user.
– These advantages make ECC particularly useful in resource-
constrained environments, such as mobile and Internet of
Things (IoT) devices.
Crypto-Currency and Block-Chain
Technology
• Many Crypto-Currencies, including Bitcoin,
Ethereum and Litecoin, utilize elliptic curve
cryptography for generating public and private
key pairs, as well as for signing transactions.
ECC provides the cryptographic security
needed for securing digital assets and ensuring
the integrity of Block-Chain networks.
Algebraic Description of Addition
• For two distinct points, P = (xP , yP) and Q = (xQ, yQ), that are not
negatives of each other, the slope of the line “L” that joins them
is
Δ = (yQ - yP)>(xQ - xP)
• There is exactly one other point
where l intersects the elliptic curve, and that is the negative of the
sum of P and Q. After some algebraic manipulation, we can
express the sum R = P + Q as:

xR = ∆ 2 - x P - x Q
yR = -yP + ∆(xP - xR)
Algebraic Description of Addition
• We also need to be able to add a point to itself:
P + P = 2P = R. When yP ≠ 0, the expressions
are:
Elliptic Curves over Zp
• The rules for addition over Ep(a, b), correspond to the algebraic
technique described for elliptic curves defined over real numbers.
• For all points P, Q ∈ Ep(a, b):
Elliptic Curves over Zp
Elliptic Curves over Zp
ECC Diffie–Hellman Key Exchange
Elliptic Curve Encryption and
Decryption
• To encode the plaintext message m to be sent as
an (x, y) point Pm.
Application of Elliptic Curve Cryptography
• Diffie-Hellman: The basic public-key cryptosystem suggested for secret key
sharing is the Diffie-Hellman protocol. If A (Alice) and B (Bob) initially agree on a
given curve, field size, and mathematical type. They then distribute the secret key
in the following manner. We can see that all we need to build the Diffie-Hellman
protocol is scalar multiplication.
• Elliptic Curve Digital Signature Algorithm (ECDSA): ECC is one of the most
widely utilized digital signature implementation approaches in cryptocurrencies. In
order to sign transactions, both Bitcoin and Ethereum use the field inverse
multiplication, but also arithmetic multiplication, inverse function, and modular
operation.
• Online application: Moreover, ECC is not limited to cryptocurrencies. It is an
encryption standard that will be utilized by most online apps in the future due to its
reduced key size and efficiency. Most commonly used in cryptocurrencies such as
Bitcoin and Ethereum, along with single-way encryption of emails, data, and
software.
• Blockchain application: The cryptocurrency Bitcoin employs elliptic curve
cryptography. Ethereum 2.0 makes heavy use of elliptic curve pairs with BLS
signatures, as stated in the IETF proposed BLS specification, to cryptographically
ensure that a specific Eth2 validator has really verified a specific transaction.
Elliptic Curve Digital Signature
Algorithm (ECDSA)
• Elliptic Curve Digital Signature Algorithm (ECDSA) is a
widely used cryptographic algorithm for creating digital
signatures.
• It relies on the mathematics of elliptic curves over finite fields
to provide a secure and efficient method for digital signature
generation and verification.
• In ECDSA n is approximately

1157920892373161954235709850086879078528375642790749
0438260516314151816149433711579208923731619542357098
5008687907852837564279074904382605163141518161494337.
• “n” is the order of a point on the curve is the number of times the
point must be added to itself until it reaches the point at infinity.
Idea behind ECDSA
ECDSA
• Key Generation:
• Choose an Elliptic Curve:
– Select a specific elliptic curve over a finite field. The curve is
represented by the equation

– y2=x3+ax+b
– along with certain parameters.
• Select a Base Point:
– Choose a base point (G) on the elliptic curve.
• Generate a Private Key:
– Select a random integer (private key, d) from a specified range.
• Calculate the Public Key:
– Compute the public key (Q) by multiplying the base point (G) by the
private key (d):

– Q = d.G
ECDSA
• Signature Generation:
• Choose a Random Number:
– Select a random number (k) from a specified range.
• Calculate a Point (x, y) on the Curve:
– Compute the point (x, y)=k.G
• Calculate R (X-coordinate of the Point):
– R = x mod n, where n is the order of the base
point.
• Calculate S (Signature Component):
– S=(k−1.(H(m) + d.r)) mod n,
– Where H(m) is the hash of the message.
• The Signature is (R, S).
ECDSA
• Signature Verification:
• Receive Signature (R, S), Public Key Q, and the Message m.
• Check that R and S are within the valid range(not equal to zero).
• Calculate W (Multiplicative Inverse of S):
W=S−1 mod n.
• Calculate u1​and u2​:
u1​=(H(m).w) mod n
u2​=(R.w) mod n
• Calculate the Point (x, y) =u1​.G + u2​.Q
• Verify that R equals the X-coordinate of the resulting point:

R = = X mod n
– If true, the signature is valid; otherwise, it is invalid.
ECDSA
Example
private key =
1127575574181142035880934023364522067755657511792319
77388358956335153294300646

public key =
{ x:
338862860998134191820545952520423487421469509146083
22024530631065951421850289,
y:
952975295348788123369407826395340711622249963235929
8014255097182349749987176
}
Demo ECDSA
• https://
kjur.github.io/jsrsasign/sample/sample-ecdsa.h
tml
• https://learnmeabitcoin.com/technical/ecdsa
Hashing Algorithm
• A hashing algorithm is a mathematical function that takes an
input of any size (like a text, password, or file) and produces a
fixed-size output, called a hash value or message digest.
• It acts like a unique digital fingerprint for that input.
• It's one-way, meaning you can't reverse the process to get the
original input from the hash value.
• Key properties:
– Deterministic: Same input always yields the same hash
value.
– Fast to compute.
– Difficult to find two inputs that produce the same hash
value (collision resistance).
How it works
• Input: You feed any data (text, file, etc.) into the algorithm.
• Hash function: The algorithm applies mathematical
operations to scramble and condense the input.
• Hash value: A unique, fixed-size string of characters (the
fingerprint) is generated.
Common uses
• Data integrity: Ensure data hasn't been tampered with by
comparing hash values before and after transmission or
storage.
• Password storage: Securely store passwords without
storing them in plain text.
• Digital signatures: Verify the authenticity of digital
documents and messages.
• File identification: Quickly detect duplicate files or
malware.
• Block-chain technology: Essential for linking blocks of
data in a secure and tamper-proof manner.
Popular hashing algorithms
• MD5 (Message-Digest Algorithm 5)
• SHA-1 (Secure Hash Algorithm 1)
• SHA-256 (Secure Hash Algorithm 256)
• SHA-3 (Secure Hash Algorithm 3)
• RIPEMD-160 (RACE Integrity Primitives
Evaluation Message Digest)
SHA-256
 SHA-256 stands for Secure Hash Algorithm 256-bit.
 It's a widely used cryptographic hash function that
generates a unique 256-bit (32-byte) hash value for any
input data.
 It's known for its security and collision resistance, making
it suitable for sensitive applications.
Key features
• Output size: 256-bit hash value (64 hexadecimal
characters)
• Collision resistance: Extremely difficult to find
two inputs that produce the same hash value
• Deterministic: Same input always yields the same
hash value
• Irreversible: Cannot recover the original input
from the hash value
• Fast: Efficient to compute
Use in Block-chain Technology
Requirement of SHA 256
How it works
• Padding: The input is padded with extra bits to
make its length a multiple of 512 bits
Parameters
Parameters
Mathematical Operations
w is Number of bits in a word.
Initial Hash Value
• For SHA-256, the initial hash value, H(0), shall consist of
the following eight 32-bit words, in hex:
H0(0) = 6a09e667
H1(0) = bb67ae85
H2(0) = 3c6ef372
H3(0) = a54ff53a
H4(0) = 510e527f
H5(0) = 9b05688c
H6(0) = 1f83d9ab
H7(0) = 5be0cd19
– These words were obtained by taking the first thirty-two bits of
the fractional parts of the square roots of the first eight prime
numbers.
Sixty Four 32-bit words
Padding
• Suppose that the length of the message, M, is L bits.
• Append the bit “1” to the end of the message, followed by k zero
bits, where k is the smallest, non-negative solution to the equation L
+ 1 + k ≡ 448 mod 512 .
• Then append the 64-bit block that is equal to the number L
expressed using a binary representation.
• For example, the (8-bit ASCII) message “abc” has length 8 × 3 =
24 , so the message is padded with a one bit, then 448 − (24 + 1) =
423 zero bits, and then the message length, to become the 512-bit
padded message.
Working Continue…..
• SHA-256 used to hash a message, M, having a length of L bits,
where 0 ≤ L < 264 .
• The algorithm uses
1. A message schedule of sixty-four 32-bit words.
2. Eight working variables of 32 bits each, and
3. A hash value of eight 32-bit words.
• The final result of SHA-256 is a 256-bit message digest.
• The words of the message schedule are labeled W0, W1,…, W63.
• The eight working variables are labeled a, b, c, d, e, f, g, and h.
• The words of the hash value are labeled H0(i) , H1(i) … H7(i), which
will hold the initial hash value.
• H(0), replaced by each successive intermediate hash value (after
each message block is processed), H(i) , and ending with the final
hash value, H(N).
• SHA256 also uses two temporary words, T1 and T2.
Working Continue…..
• Message blocks: The padded input is divided into 512-
bit blocks.
• Initialization: Eight 32-bit initial hash values (H0 to
H7) are set.
• Compression function: Each block is processed
through 64 rounds of mathematical operations
(including bit shifts, logical functions, and modular
additions) using the initial hash values and constant
values.
• Final hash: After processing all blocks, the final 256-bit
hash value is produced
Working Continue…..
• SHA-256 both use six logical functions, where each
function operates on 32-bit words, which are represented as
x, y, and z. The result of each function is a new 32-bit word

Choice and Majority Function


SHA-256 Hash Computation
• The SHA-256 hash computation uses functions and
constants previously discussed. Addition (+) is performed
modulo 232.
• Each message block, M(1), M(2), …, M(N) , is processed in
order, using the following steps:
SHA-256 Hash Computation
SHA-256 Hash Computation
SHA-256 Hash Computation
SHA-256 Computation Diagram
Applications
• Digital signatures
• Password storage
• Data integrity verification
• Block-chain technology (e.g., Bit-coin)
• File integrity checking
• Software updates
• Secure communication protocols
• Security:
– No known practical attacks to find collisions for SHA-256.
– Considered secure for current and future applications.
Immutable Ledger
• An immutable ledger, as the name suggests, is a record-
keeping system that cannot be altered or modified once
information is added to it.
• In the context of block-chain, this ledger is decentralized and
distributed across a network of computers (nodes).
• Each node on the network maintains a copy of this ledger, and
any changes made to it are recorded in a transparent and
tamper-proof manner.
Decentralization and Consensus
• The immutability of the ledger is achieved through the principles of
decentralization and consensus.
• In a Block-chain network, transactions are bundled into blocks, and
these blocks are linked together in chronological order to form a chain.
• To alter a single piece of information in a block, an attacker would need
to alter that block and all subsequent blocks across the entire network.
• This task is virtually impossible due to the network's decentralized
nature and the consensus mechanism that governs it.
Cryptographic Hashing
• Another key factor that ensures immutability is
cryptographic hashing.
• Each block in the Block-chain contains a unique
cryptographic hash of the previous block.
• If any data in the previous block is altered, it would
change the hash, thereby invalidating the entire
chain.
• This design makes it exceedingly difficult for
anyone to tamper with the data stored in the Block-
chain.
Benefits of Immutable Ledger in Block-chain
• Data Integrity:
– Once data is added to the blockchain, it cannot be altered or deleted. This ensures the integrity
of the information stored on the ledger, reducing the risk of fraud or tampering.
• Trust and Transparency:
– Immutability builds trust among participants in the blockchain network. All parties can be
confident that the information on the ledger is accurate and unchanged, fostering transparency
in transactions.
• Security:
– The immutability of the ledger is achieved through cryptographic hashing and consensus
mechanisms, making it extremely difficult for malicious actors to manipulate the data. This
enhances the security of the entire blockchain network.
• Audibility:
– The transparent and unchangeable nature of the ledger simplifies auditing processes. Auditors
can trace transactions and verify the authenticity of data without relying on trust in a central
authority.
• Reduced Fraud:
– The tamper-resistant nature of the blockchain ledger significantly reduces the risk of fraudulent
activities. Any attempt to alter data in previous blocks would require consensus from the
majority of the network, making fraud difficult and costly.
Benefits of Immutable Ledger in Block-chain
• Smart Contracts Reliability:
– Smart contracts, which are self-executing contracts with the terms of the agreement
directly written into code, rely on the immutability of the blockchain. Once a smart
contract is deployed, its code and execution are unchangeable, ensuring reliability and
predictability.
• Decentralization:
– Immutability contributes to the decentralization of the blockchain network. Since there is
no central authority controlling the ledger, the system is more resistant to censorship and
single points of failure.
• Historical Data Accuracy:
– The historical records stored in the immutable ledger provide an accurate and reliable
history of transactions. This historical data is valuable for analysis, compliance, and
decision-making processes.
• Dispute Resolution:
– In case of disputes, participants can refer to the immutable ledger to settle disagreements.
The unalterable nature of the ledger provides an objective and irrefutable record of
transactions.
• Long-Term Stability:
– The immutability of the ledger enhances the long-term stability of the blockchain.
Participants can rely on the consistency and permanence of data, even as the network
evolves and grows.
Real-World Applications
• Cryptocurrency Transactions
• Blockchain's immutable ledger is at the core of
cryptocurrencies like Bitcoin and Ethereum. It
ensures the security and transparency of
transactions.
• Supply Chain Management
• Immutable ledgers can track the movement of
goods from manufacturer to consumer, reducing
fraud and ensuring product authenticity.
Real-World Applications
• Voting Systems
• Blockchain-based voting systems use immutable
ledgers to securely record votes, preventing
tampering and ensuring the integrity of elections.
• Healthcare Records
• Blockchain healthcare systems ensure the security,
accessibility, and tamper-proof nature of medical
records stored on their immutable ledgers, thereby
enhancing both patient care and data integrity.
Real-World Applications
• Real Estate
• Blockchain can revolutionize real estate by
providing an immutable ledger for property
transactions, reducing fraud and speeding up
the buying and selling process.
Block-chain Token
• A blockchain token is a digital or cryptographic representation
of an asset or utility on a blockchain.
• These tokens are typically created, managed, and transacted
within a blockchain network.
• They can represent various types of assets or rights, and their
functionalities can range from acting as a form of currency to
representing ownership of real-world assets or access to specific
services.
• Example:
• Cryptocurrency Tokens:
– These are digital tokens that serve as a medium of exchange within a
blockchain network. Examples include Bitcoin (BTC) and Ethereum
(ETH).

You might also like