Professional Documents
Culture Documents
Unit 1 Basic Cryptography For Student - PPTX 2
Unit 1 Basic Cryptography For Student - PPTX 2
Unit 1 Basic Cryptography For Student - PPTX 2
Blockchain
Technology
Unit 1: Basic Cryptography
Fri, Sep 17
By #satochit
● Hashing function
● Digital signature
● Address
● Wallet
Hash Function
● กระบวนการทําให data มีขนาดเล็กลง -> data fingerprint
● เปน one way function (รู hash value ไมสามารถยอนหา original message ได
● มีคุณสมบัติ deterministic (given input always same hash value)
● Bitcoin Address
● Transaction, Block
● Chaining Block into Blockchain
● Mining the Block
https://xorbin.com/tools/sha256-hash-calculator
05cec7dc7d7ecbd024db81ca28c984dd7 3837607ff0f050a0aeb32430d9e522ffe
e260117b85e1056703d876c5c97f356 d46594783bd673d2a22be81a8271239
Public-key Cryptography
● Private key = secret key
● Public key = sharable key
● Lock = encrypt
● Unlock = decrypt
Alice Bob
If Alice want to lock a message for Bob, After Bob receive the message, which key
which key to use? to use to unlock the message?
Quiz
“Bob want to send the secret message to Alice” Please fill in the blank
“Bomb time
Bob
is 21.00 Fri,
Sep 17”
Choices
A. Encrypt
B. Decrypt 21b9789496580c1546675ed11dacbe526
C. Hash 996fb5796c6c068e55522185f778b3e
D. Alice’s Public Key
E. Alice Private Key
F. Bob Public Key
G. Bob Private Key
“Bomb time
Alice is 21.00 Fri,
Sep 17”
How public-key cryptography works in Bitcoin
1. You send me a copy of your public key
Me You
Digital Signature (1/2)
● To sign or certify the message เซ็นตรับรอง
ขอความ เอกสารขอตกลง หรือ sign
transaction
Alice
ENCRYPT
Alice’s Private Key
เรียกขอมูลชุดนี้ d73jY9M8/LyQPCjejEkiNaT+PUl9spI+v7kMn3TyGtlY
zbKio7JGmCSjicbON1hcV/uLQWgQUMprnFRJ/yKppVSo
วา
DIGITAL SIGNATURE sq1vC25P9Xe6P5VbnA+wWTuyvyMuG1KiOFw+rIGcKXjs
7QlhTIil+2jxpip2R+0GM2DZvbrHqFkzpMITn04
Digital Signature (2/2)
● To verify if it’s true that Alice sign the
message ใครๆสามารถตรวจสอบไดวา Alice
เปนคนเซ็นตรับรองขอความนี้
If equal “YES”
1 If not equal
- Message change
-OR-
Bob
2 - Alice not sign
d73jY9M8/LyQPCjejEkiNaT+PUl9sp
I+v7kMn3TyGtlYzbKio7JGmCSjicbO 7ba40fa085977af531dff8467ed11848b
N1hcV/uLQWgQUMprnFRJ/yKppVSosq DECRYPT 05e5f5447f2f1c116e9ede00a40703b
1vC25P9Xe6P5VbnA+wWTuyvyMuG1Ki
OFw+rIGcKXjs7QlhTIil+2jxpip2R+
0GM2DZvbrHqFkzpMITn04
Alice’s Public Key
DIGITAL SIGNATURE
QUIZ
● 3 things needed to verify Alice’s DIGITAL SIGNAURE
1. ______________________________________________
2. ______________________________________________
3. ______________________________________________
Address
● Public and private keys are generally used for locking and unlocking messages
● The two keys are mathematically related
● The public key is made from the private key
● The private key can’t be regenerated from the public key
● In Bitcoin, keys are used for locking and unlocking bitcoin on the blockchain
● Address are related to public key, the bitcoin address is generated from its public key
Private Key Hexadecimal Format (64 characters [0-9A-F]):
446A6887326ED5C9F3A428BE9972FB6F7CA3A27FFDF14D1FD1A21107A982FFDA
Bitcoin Address
13wbbTtHzJASxo2YEahdqzdyJEK7twRV6d
Wallet
● To store and spend money
● Not hold the value directly but hold access to it on the blockchain
● The private key stored in your bitcoin wallet 🡪 ability to move funds
● If you lose keys, you lose access to your funds
● We can store our private keys in different ways
Hint: https://www.rapidtables.com/convert/number/hex-to-decimal.html
Q&A