hello! this is Hong from computing architecture lab
from NAIST, in Japan
today i'm gonna talk about asymmetric cryptography
which is one of the key technology
we use to secure the blockchain network
okay, firstly let's go to the basic idea
do you know about the post-mail?
I guess the answer would be yes!
I take postmail as an example to explain about the owner-relationship
between a human with the asset (letter)
In the postmail, we have public address, like your house address
a public address is used so that the other people can send you a letter
and then there is a private key so that the owner can open the mailbox
to get the letters inside
In this case if anyone keeps the private key
he can open the mailbox to see the content inside
it means that he is the owner of these letters
okay, similarly to this idea, the asymmetric cryptography is used in blockchain
to protect the owner relationship
When you join a blockchain network
and if you create an account
it means that you are running an asymmetric cryptography algorithm
to generate two keys: public key &  private key
the public key is equivalent to the mailbox address
and private key is equivalent to the mail mailbox's secret key
to open the mailbox
okay, the characteristic of these two keys is like this:
if you use a key to encrypt the data
you can use the other key to decrypt that data
and vice versus
for example, in here if we have the message "hello world"
and we use the public key to encrypt this message
then we can use the private key to decrypt this message
to see the original information "hello world", okay?
and again..
if you use the private key to encrypt the "hello world"
then you can use the public key to decrypt the message
to see the original information "hello world" in here
okay, that is the characteristic of the asymmetric cryptography
now let's see how the asymmetric cryptography is used in blockchain !
there are 2 usage cases:
The first is: public to private key
in this case of usage, it's similar to the case when you use the postmail
the data will be encrypted by using the public key of the receiver
and then at the receiver, the receiver will decrypt the data
by using his own private key
by using this way anyone in the network can send the data to the receiver
but only the receiver can open or decrypt the data
here is more detail!
now we have a plain text
if we want to send this plain text message to someone
we use the public key of that person to encrypt the plain text data
to generate a cipher text
at the receiver, that person will use his own private key to decrypt the information
to get back the plain text information
okay do you get it?
and another usage case is: private to public
this case is similar to the digital signature
you know that when you send someone some information (letter)
you need to sign in the letter
to prove that you are the real person that send this message
not any other one, right?
you need a signature!
this signature is important to show to the  the receiver
knowing that this is not a fake message from someone else not you
in this case, when you send a data message
you will create the hash of this message
and this hash will be encrypted by using your own private key
and the result will become the digital signature
and you attach this digital signature together with your message
and send to the receiver
at the receiver, he or she will verify your message (your signature)
by doing as follows:
firstly
the receiver will get the message
and compute the hash of the message to get the result
in another way he's also get your signature
and decrypt the signature by using your public key
the sender's public key
the result should be a hash value
that match with the hash of the message here
if the two hash values are matched
it means that the message is really from that sender
it means that the sender keep the private key
or, it's proved that the signature is correct!
okay, do you got it?
In more detail, let's say you send an "hello world" message
firstly you calculate the hash of this message
and then you use your private key to encrypt this message
and this message (the result) becomes your signature
here you attach the signature with your message "hello world" here
and send together
at the receiver, they get the hello message
they calculate the hash of the "hello world" message
at the same time they decrypt your signature by using your public key
to get another hash
if the two hash values' matched
it means that your signature is correct
but if the hashes are not matched,
it means that your signature is incorrect
it means that this is a fake message
and they will do not believe that this message is from you
let's overview
how the asymmetric cryptography is used in the blockchain network!
let's say.. in the network we have the sender A
and the receiver B
there are some miners that take care on writing the data into the blockchain ledger
okay ?
and A.PUK is the public key of the sender A
A.PRK is the private key of sender A
now the A wants to send some data to the B
firstly, he or she (A) will encrypt this data by using the public key of B
to get a message
then he (A) calculates the hash of this message
and use his own private key to encrypt this information
to generate the signature
okay, and he send  the message and the signature together
to the mining pool
and then the miner will take this transaction information from the mining pool
and before writing this data into the blockchain ledger
he must check whether this message is really from A or not
or someone else may attempt to be A
fake to be A, to send a message or not?
he's not sure, so he must check it first
to check it, he will he get back this message
and calculate the hash of the message
and check the signature by decrypt the signature information
using the public key of the sender A
if the results are matched
it means that the signature here is correct
incase the signature is correct he will try to write this information
into the blockchain ledger
okay, do you got it ?
at the receiver side, the receiver B here will get back the Trans.1 here
(the information that A sent to him)
and using his own private key (B's private key)
to decrypt the data to get back the original data
that A sent to B
That is how the asymmetric cryptography is used
in blockchain network
and here is the sender sign for the transaction
and this is the miner verifies for the signature
and this case of using: we call it "public to private"
because we use the public key to encrypt data
and use the private key to decrypt data
and this signature .. we call it "private to public" usage case
because we use the private key to encrypt data
and use the public key to verify the signature
(to decrypt the data)
okay, do you got it ?
let's say about some popular asymmetric cryptographic algorithms
that we're using nowadays
the first one we must talk is the RSA
the RSA algorithm is used by most of the blockchain network nowadays
and the other algorithms are: Diffie-Hellman Key Exchange
Elliptic-curve cryptography
Paillier cryptosystem
and, so on...
You can check more detail about these algorithms in the internet, google,...
that's all for our lecture today's
if you have some questions or comments
please send me emails, or comment below this video
thank you so much for your listening!
Lets SUBSCRIBE our channel
