0% found this document useful (0 votes)
47 views18 pages

Unit II Blockchain

The document provides an overview of cryptography, detailing its historical evolution from ancient methods to modern asymmetric encryption techniques like public-key cryptography. It explains the significance of hashing in blockchain technology, including how it ensures data integrity and security through mechanisms like hash pointers and Merkle trees. Additionally, it highlights the role of cryptographic processes in facilitating secure cryptocurrency transactions and maintaining the transparency of blockchain ledgers.

Uploaded by

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

Unit II Blockchain

The document provides an overview of cryptography, detailing its historical evolution from ancient methods to modern asymmetric encryption techniques like public-key cryptography. It explains the significance of hashing in blockchain technology, including how it ensures data integrity and security through mechanisms like hash pointers and Merkle trees. Additionally, it highlights the role of cryptographic processes in facilitating secure cryptocurrency transactions and maintaining the transparency of blockchain ledgers.

Uploaded by

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

Unit II

Cryptography:
• Cryptography is the encryption of data so that it is only known by the
intended parties.
• It is one of the important human inventions and has very long history.
• Ancient Greeks and Romans used to send secret messages by
substituting letters only decipherable with a secret key.
• During world war II innovation in encryption was pushed to new
heights, because messages concerning vital information such as troop
movements were broadcast.
• Anyone with a radio can listen to them, and so it was vital that only
the intended audience could understand the messages.

• The Germans developed an encryption machine called Enigma


especially designed for the German military (including the navy) so
they could send messages over the radio.

• Later sciences developed a new method that allowed anyone to send


each other private and secure messages.
Machines that encrypted data in the past:
• The Enigma device was revolutionary . It changed each letter in a
complex manner.
• One letter would swap for another letter multiple times via
mechanical rotors. The number of rotors added to the difficulty of the
encryption.
• Only someone with a daily encryption sheet that had the key would
know how to unwrap the letters.
• Enigma was the strongest encryption method at the time.
• Eventually, allied forces uncovered how the Germans were encrypting
their messages.
• Joan Clarke and Alan Turing were important code breakers. They
would decode messages everyday, but this was tremendously difficult.
• The Germans kept adding new rotors that would swap the letters
more times.
• Each new rotor added to the mathematical difficulty and eventually
made it nearly impossible for Joan Clarke and Alan Turing to solve the
encryption key for that day.
• The need to solve the German’s Encryption key led to the
development of a mechanical computer called The Bombe.
• With help from Polish code breakers, Alan Turing developed it at a
British government security facility called Bletchley Park.
• The Bombe could quickly solve the encryption key that was being
used by the Germans that day.
• The Enigma, like all other encryption before, was using what is known
as symmetric key encryption. The same key was used to encode a
message and decode it.
Modern Encryption:
• The next big leap in encryption did not come until 1975 when
Whitfield Diffie and Martin [Link] wrote a paper called “New
Directions in Cryptography”.
• In it they described a brand-new way of encoding messages. It
allowed anyone to send a secret message to another person they had
not had in contact with before, even without the recipient’s
encryption key.
• From Enigma the encryption key was needed both to encode and
decode a message.
• The encryption technique that Diffie and Hellman developed is
commonly known as public-key cryptography or more technically
“asymmetric cryptography”.
• It uses a pair of keys, both a public key that everyone knows so they
can send you an encoded message and a private key only you know so
only you can decode messages sent to you.
• Asymmetric cryptography allowed, for the first time, anyone to
encrypt a message using the recipient’s public key, while the
encrypted message could only be read with the recipient’s private key.
• It is one of the essential technologies that allows blockchain
technology to exist.
• It also allows cryptocurrency to be sent securely from one address to
another.
Private and Public Keys:
• Let’s take a look at how blockchain use asymmetric encryption,
known as public-key cryptography, to secure the transfer of crypto
currency from one address to aother.
• Blockchain ledgers are widely distributed public accounts that let
anyone see who has what cryptocurrency and the full history of that
coin over time. You can look up any transaction and see who sent it.
• Asymmetric encryption allows a sender to transfer cryptocurrency to
the recipient without someone else being able to steal it.
• It allows them to do this without having met or exchanged
information.
• As long as the sender has the public key of the recipient, they can
send them cryptocurrency.
• The public-key on a blockchain is the “address”.
• The address and the private key are connected mathematically and have
specific fascinating mathematical properties.
• The public key and private key are created together by combining
randomly chosen, ridiculously huge prime numbers.
• Prime numbers are whole numbers that can only be divided by
themselves.
• If you encode a message, such as the transfer of cryptocurrency to a new
address, using a recipient’s public key, the recipient can decode it using
their matching private key and gain ownership of the cryptocurrency.
• Whoever is in possession of the private key can transfer cryptocurrency
to a new address.
• The ledger holds a record of all these transfers between addresses.
Anyone can see the history of transmission between addresses.
Hashing in Blockchain:
• What is Hashing in Blockchain?
• Hashing in blockchain is a cryptographic process.
• One where data, like transaction details in a block, is converted into a fixed-
length string of characters, known as a hash.
• This unique digital fingerprint ensures data integrity and immutability.
Crucially, even a minor alteration in the original data produces an entirely
different hash.
• Hashing is integral to the security of blockchain, forming the basis for
creating blocks, chaining them together, and generating digital signatures.
• It prevents tampering attempts, as altering a block requires recalculating the
hashes of every subsequent block, a practically impossible feat as it requires
a lot of computing resources.
• In essence, hashing safeguards the transparency, trust, and security of
blockchain technology.
How Hashing Works in Blockchain?
• In blockchain, each block contains a hash of its data, the previous
block’s hash, and a timestamp.
• Changing any block’s data alters its hash, disrupting the entire chain.
This immutability ensures data integrity, enhances security, and
facilitates consensus algorithms.
• Popular blockchain hash functions include SHA-256.
• The decentralized nature of blockchain relies on hashing and
consensus mechanisms to maintain a secure and transparent
transaction validation and history.
Hash Functions:
• Hash functions are algorithms that transform input data into a fixed-
size string of characters, known as a hash.
• They produce a unique hash for each distinct input, facilitating data
integrity verification.
• Blockchain hash functions enhance security by generating irreversible
and unique representations of data.
• Uses of Hash Functions in Blockchain:
• Blockchain hash functions are employed to create unique identifiers
(hashes) for blocks of data, linking them in an immutable chain.
• Hashes enable efficient data retrieval, consensus mechanisms, and
tamper detection, reinforcing the trustworthiness of blockchain
transactions.
Hash Pointer:
• A hash pointer is a data structure similar to a pointer, but it also
contains a cryptographic hash of the data referenced.
• Thus, a hash pointer tells you where to access a specific piece of data
and allows you to check the integrity of the data accessed.
• The structure of a blockchain can be more accurately described as a
linked list that uses hash pointers.
• The hash of the previous block is a hash pointer that points to a set of
transactions and a hash of all those transactions.
• Hash pointers facilitate block linking, the integrity of each block, and
verifying that newly added blocks correctly follow the previous blocks.
• Hash pointers are used to efficiently chain blocks together.
Merkle Tree:
• A Merkle tree is a data structure used to organize and verify large sets of
data.
• The data is organized into a tree-like structure where each leaf, or node,
is labelled with the hash of a set of data.
• Each non-leaf node is a hash of its child nodes.
• Merkle trees are used to verify transactions included in specific blocks
that are propagated to the blockchain.
• Transactions are batched together in a list to form a block. Each
transaction in the list is hashed using a good hashing function.
• These hashes serve as the leaf nodes.
• These leaf nodes are hashed together in pairs to create a new layer of
hashes.
• This process continues iteratively until there is a single hash remaining
known as the Merkle root.
Merkle Root:
• Merkle root is stored in the block’s header and acts as a digital fingerprint of all the
transactions within that block.
• We can also refer to the Merkle root as the block’s hash.
• So when we say a new block is linked with a previous block using the previous block’s
blockhash, we are saying the block uses the previous block’s Merkle root as a part of
the new block's hash.
• Merkle trees provide a cryptographic “shortcut” to aid in this verification process
known as a Merkle proof.
• A Merkle proof is a path from the transaction’s leaf node all the way up to the Merkle
root. Using the figure above, think of it as a path from Data A to the Merkle root.
• This path also includes its sibling nodes, the leaves adjacent to each node on the path
but are not part of the path themselves.
• A verifier can compute a hash using the proof path to check whether their computed
hash matches the Merkle root. If the resulting hash matches, the verifier is confident
that the transaction is legitimate and has not been tampered with.

You might also like