0% found this document useful (0 votes)
26 views32 pages

Lecture 3

Uploaded by

boooom86608
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)
26 views32 pages

Lecture 3

Uploaded by

boooom86608
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
You are on page 1/ 32

Algorithms & Techniques

Public-Key Cryptography
Two Techniques

● Securing the chain


● Efficient validation and verification.
● 1) Asymmetric key encryption
● 2) Hashing.
● These techniques depend on several complex proven algorithms
Public-Key Cryptography
● Recall that blockchains decentralized network participants, are not
necessarily known to each other.
● Credentials cannot be checked by the conventional means such as
verifying who you are with your driver's license.
● Participants can join and leave the chain as they wish.
● They operate beyond the boundaries of trust.
● Given this context. how do you identify the peer participants?
● How do you authorize and authenticate the transactions?
● How do you detect forged or faulty transactions?
● Public-key cryptography algorithm
Simple Symmetric Key Encryption

● The same key is used for encryption and decryption


● so it is called symmetric key
● Example, Ceasar encryption is the simplest one with alphabets of a
message are shifted by a fixed number,
● This number is called the Key
Let's now examine how Public-key cryptography addresses
these issues.
Instead of a single secret key,

it employs two different keys that take care of both the issues of symmetric key
encryption.
Two properties with a key pair.

● Encrypting function holds two properties with a key pair.


● The public-key private key pair has the unique quality that even
though a data is encrypted with the private key,
● it can be decrypted with the corresponding public-key and vice versa.
Why ECC not RSA?

● ECC is stronger than RSA for a given number of bits.


● Did you know that 256 bit ECC key pair is equal in strength to about
3072 bits of RSA key pair.
● Both bitcoin and Ethereum use ECC based algorithms for their
encryption needs.
Hashing
Hashing

● A hash function or hashing transforms and maps an arbitrary length of


input data value to a unique fixed length value
● The algorithm chosen for the hash function should be a one-way
function and it should be collision free
● No one can derive the original items hashed from the hash value
● Can you make potatoes out of mashed potatoes?
SHA 256

● Most common hash size now is 256 bits and the common functions
are SHA-3, SHA-256 and Keccak.
● Hash value space, how good is 256 bits hash?
● A 256-bit hash value space is indeed very large. 2 to the power of 256
possible combinations of values.
● That is approximately 10 to the power of 77. That is 10 followed by 77
zeros.
Two Stucture of Hash

Simple Linear Hash

Tree Structure Hash (Merkle Tree)


Transaction Integrity
Tran
The digital signing process

● Data is hashed and encrypted.This is the digital signature. the secure


hash digitally signed
● Receiver can recompute the hash of the original data received
● and compare it with the received hash to verify the integrity of the
document
Now, consider the transaction to be that data.

Step number 1,(GENERATE HASH) find the hash of the data fields of the
transaction.
Step number 2,(SIGNED UNSIGNED HASH) encrypt that hash using the
private key of the participant originating the transaction. Thus, digitally
signing the transaction to authorize and making the transaction non-
repudiable.
Step number 3, this hash just added to the transaction. It can be verified
by others decrypting it using the public key of the sender of the
transaction, and recomputing the hash of the transaction.

You might also like