Hashing and Signatures Slides
Hash and Sign
Cryptographic Primitives
The Digital Fingerprint
Can you create a digital fingerprint that changes entirely if even a single comma is altered in a 1,000-page document?
This is the power of Hashing.
Cryptographic Hash Functions
A mathematical algorithm that maps data of arbitrary size to a bit string of a fixed size (the hash).
Crucial Properties:
- Deterministic: Same input always produces same output.
- Pre-image Resistance: Hard to find input given hash.
- Collision Resistance: Hard to find two different inputs with same hash.
Input: "Hello Blockchain"
SHA-256: 41b1236162391629837a...
Digital Signatures
1. Key Pairs
Generate a Private Key (Secret) and a Public Key (Identity).
2. Signing
Combine Hash(Message) + Private Key to create a Signature.
3. Verification
Anyone can use the Public Key to verify the signature is authentic.
ECDSA Mechanics
Blockchain relies on Asymmetric Cryptography.
Private Key Ownership & Authority
Public Key Address & Validation
Verification Logic
\[ \text{Verify}(m, \sigma, PK) = \text{True/False} \]
Where:
\( m \): Original Message Hash
\( \sigma \): Digital Signature
\( PK \): Public Key
"If the message changes by one bit, the hash changes, and the signature verification fails."