You have 3 free guides left 😟
Unlock your guides
You have 3 free guides left 😟
Unlock your guides

2.2 Public key cryptography and digital signatures

3 min readjuly 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
Top images from around the web for Principles of public key cryptography
  • 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 :
    1. Signer hashes message or transaction data using ()
    2. Signer encrypts hash using their private key, creating
    3. Signer attaches digital signature to original message or transaction
  • Verifying a digital signature:
    1. Verifier hashes received message or transaction data using same
    2. Verifier decrypts digital signature using signer's public key, obtaining original hash
    3. 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
© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.


© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.
Glossary
Glossary