2.2 Public key cryptography and digital signatures
3 min read•july 18, 2024
forms the backbone of blockchain security. It uses asymmetric key pairs for encryption, decryption, and digital signatures, enabling secure and authenticated transactions without revealing private keys.
Blockchain applications leverage cryptography for user identification, , and smart contract interactions. This ensures , , , and while maintaining user privacy through pseudonymous addresses.
Public Key Cryptography
Principles of public key cryptography
Top images from around the web for Principles of public key cryptography
Asymmetric-Key Encryption and Digital Signatures in Practice - sergioprado.blog View original
Is this image relevant?
1 of 3
uses a pair of keys: public key widely distributed for encryption and kept secret for decryption
creates public-private using algorithms ( or ECC)
Private key generated randomly and used to derive corresponding public key
Encryption converts plaintext to ciphertext using recipient's public key
Sender uses recipient's public key to encrypt message
Only recipient's private key can decrypt ciphertext back to plaintext
Decryption converts ciphertext to plaintext using recipient's private key
Recipient uses private key to decrypt ciphertext and retrieve original message
Digital signature creation and verification
Digital signatures provide authentication, integrity, and non-repudiation in blockchain transactions
Creating a :
Signer hashes message or transaction data using ()
Signer encrypts hash using their private key, creating
Signer attaches digital signature to original message or transaction
Verifying a digital signature:
Verifier hashes received message or transaction data using same
Verifier decrypts digital signature using signer's public key, obtaining original hash
Verifier compares computed hash with decrypted hash from signature
Matching hashes indicate valid signature, authenticated and unaltered message or transaction
Non-matching hashes indicate invalid signature, altered message or transaction, or not genuine
Blockchain Applications
Cryptography in blockchain security
Blockchain networks identify users by public keys, serving as digital identities or addresses
Users sign transactions using private key, creating digital signature
Digital signature proves transaction originated from private key owner and hasn't been altered since signing
Blockchain nodes verify digital signature using user's public key before adding transaction to blockchain
Ensures only authorized users can create valid transactions and prevents unauthorized modifications
utilize digital signatures for user authentication and access control
Users sign transactions or messages to interact with smart contract functions
Smart contract verifies digital signature to ensure user is authorized to perform requested action
Benefits of cryptography for blockchains
Public key cryptography provides security and privacy benefits in blockchain applications:
Confidentiality: Transactions and data encrypted using recipient's public key, ensuring only intended recipient can decrypt and access information
Authentication: Digital signatures allow users to prove identity and ownership of transactions, preventing impersonation and unauthorized access
Integrity: Digital signatures ensure transactions and data haven't been tampered with, maintaining blockchain integrity
Non-repudiation: Digital signatures provide undeniable proof of user signing transaction, preventing later denial of involvement
Privacy enhanced by using different public keys for each transaction, making it difficult to link transactions to specific user
allows users to interact with blockchain without revealing real-world identities
Secure private key management crucial, as losing or compromising private key can result in loss of funds or unauthorized access to associated blockchain account
Best practices include hardware wallets, secure key storage, and proper key management procedures