新品发布:Cobo Agentic Wallet (CAW)—让Agent 拥有自主权,让用户掌握确定性

了解更多
close

Public Key: The Complete Guide to Public Key Cryptography and Digital Asset Security

May 07, 2026

Academy
  • Public key cryptography uses two mathematically linked keys—one public, one private—to secure digital communications and transactions

  • Unlike traditional encryption, public keys can be freely shared while private keys remain secret

  • Public key infrastructure powers modern internet security, from HTTPS to cryptocurrency wallets

  • Enterprise digital asset custody relies on advanced public key systems like MPC (Multi-Party Computation)

  • Understanding public key cryptography is essential for anyone managing cryptocurrency or building Web3 applications

A public key is one half of a cryptographic key pair used in asymmetric encryption systems. Unlike traditional symmetric encryption where the same key encrypts and decrypts data, public key cryptography uses two distinct but mathematically related keys:

  • Public key: Can be freely distributed and shared with anyone

  • Private key: Must be kept secret and never shared

Think of a public key like your email address—you can share it openly so others can send you encrypted messages. Your private key is like your email password—it allows only you to decrypt and read those messages.

This revolutionary concept, first publicly introduced by Whitfield Diffie and Martin Hellman in 1976, solved one of cryptography’s oldest problems: how to securely exchange encryption keys over insecure channels.

The Mathematical Foundation

Public key cryptography relies on trapdoor functions—mathematical operations that are easy to compute in one direction but extremely difficult to reverse without special information (the “trapdoor”).

The most common trapdoor function involves:

  1. Selecting two large prime numbers (kept secret as your trapdoor)

  2. Multiplying them together (easy operation)

  3. Performing additional mathematical operations to create the public key

  4. Factoring the product back into primes (computationally impractical without knowing the original primes)

This asymmetry creates the security foundation: anyone can use your public key to encrypt data, but only someone with the corresponding private key (containing the prime factors) can decrypt it.

Encryption and Decryption Process

Encryption workflow:

  1. Alice wants to send Bob a confidential message

  2. Alice obtains Bob’s public key (which Bob has shared openly)

  3. Alice encrypts her message using Bob’s public key

  4. The encrypted message can now only be decrypted with Bob’s private key

Decryption workflow:

  1. Bob receives the encrypted message

  2. Bob uses his private key to decrypt the message

  3. Only Bob can read the original message—even Alice cannot decrypt it once encrypted

Digital Signatures: Proving Identity

Public key cryptography also enables digital signatures—mathematical proof that a message came from a specific sender:

  1. Alice creates a message

  2. Alice encrypts a hash of the message with her private key (creating a signature)

  3. Anyone can verify the signature using Alice’s public key

  4. If the signature verifies, it proves Alice (and only Alice) created the message

This mechanism is fundamental to cryptocurrency transactions, where digital signatures prove ownership and authorize transfers without revealing private keys.

RSA (Rivest-Shamir-Adleman)

RSA remains the most widely used public key algorithm, invented in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman.

Key characteristics:

  • Based on the difficulty of factoring large prime numbers

  • Supports both encryption and digital signatures

  • Typical key sizes: 2048-bit (minimum), 3072-bit, or 4096-bit

  • Used in SSL/TLS certificates, email encryption (S/MIME), and code signing

Security consideration: RSA’s security depends on key length. As computing power increases, longer keys are required. The industry standard has moved from 1024-bit to 2048-bit minimum, with 3072-bit recommended for long-term security.

ECC (Elliptic Curve Cryptography)

ECC offers equivalent security to RSA with much smaller key sizes, making it ideal for resource-constrained environments.

Key characteristics:

  • Based on the algebraic structure of elliptic curves

  • 256-bit ECC key ≈ 3072-bit RSA key in security strength

  • Lower computational requirements

  • Increasingly popular in mobile devices, IoT, and cryptocurrency

Cryptocurrency application: Bitcoin and Ethereum use ECC (specifically secp256k1 curve) for generating public-private key pairs and creating digital signatures for transactions.

Diffie-Hellman Key Exchange

Diffie-Hellman enables two parties to establish a shared secret over an insecure channel without ever transmitting the secret itself.

How it works:

  1. Both parties agree on public parameters

  2. Each party generates a private value and computes a public value

  3. Parties exchange public values

  4. Each party combines their private value with the received public value

  5. Both arrive at the same shared secret independently

This protocol is fundamental to establishing secure TLS connections and is used in modern messaging apps like Signal for end-to-end encryption.

DSA (Digital Signature Algorithm)

DSA is specifically designed for digital signatures rather than encryption.

Key characteristics:

  • Faster signature generation than RSA

  • Slower signature verification than RSA

  • Used in government and financial applications

  • Basis for ECDSA (Elliptic Curve DSA) used in cryptocurrencies

What Is PKI?

Public Key Infrastructure (PKI) is the framework of policies, procedures, hardware, software, and people needed to create, manage, distribute, use, store, and revoke digital certificates and manage public key encryption.

Core PKI components:

  1. Certificate Authority (CA): Trusted third party that issues and verifies digital certificates

  2. Registration Authority (RA): Verifies the identity of entities requesting certificates

  3. Digital Certificates: Electronic documents that bind public keys to identities

  4. Certificate Revocation Lists (CRL): Lists of certificates that have been revoked before expiration

  5. Certificate Store: Secure repository for storing certificates and keys

How Digital Certificates Work

A digital certificate contains:

  • Public key

  • Owner’s identity information

  • Certificate expiration date

  • Digital signature of the issuing CA

  • Certificate serial number

When you visit an HTTPS website, your browser:

  1. Receives the website’s digital certificate

  2. Verifies the certificate was issued by a trusted CA

  3. Checks the certificate hasn’t expired or been revoked

  4. Confirms the certificate matches the website domain

  5. Uses the public key in the certificate to establish an encrypted connection

PKI in Enterprise Environments

Organizations use PKI for:

  • Employee authentication: Smart cards and digital certificates for network access

  • Email security: S/MIME certificates for encrypted and signed emails

  • Code signing: Verifying software authenticity and integrity

  • Document signing: Legally binding electronic signatures

  • VPN access: Certificate-based authentication for remote access

Cryptocurrency Addresses and Public Keys

In cryptocurrency systems, your public key is mathematically derived from your private key and serves as the basis for your wallet address.

Bitcoin address generation:

  1. Generate a random 256-bit private key

  2. Use ECC to derive the corresponding public key

  3. Hash the public key using SHA-256 and RIPEMD-160

  4. Add version bytes and checksum

  5. Encode in Base58 to create the human-readable address

Important distinction: Your cryptocurrency address is derived from your public key but is not identical to it. The address is a hashed version that provides an additional layer of privacy and security.

Transaction Signing and Verification

Every cryptocurrency transaction requires a digital signature created with your private key:

Transaction process:

  1. You create a transaction specifying recipient and amount

  2. Your wallet software creates a hash of the transaction data

  3. Your private key signs this hash, creating a digital signature

  4. The transaction, signature, and your public key are broadcast to the network

  5. Network nodes verify the signature using your public key

  6. If valid, the transaction is included in a block

This process ensures:

  • Authentication: Only the private key holder can authorize transactions

  • Non-repudiation: The sender cannot deny creating the transaction

  • Integrity: The transaction cannot be altered after signing

Multi-Signature (Multisig) Wallets

Multisig wallets require multiple private keys to authorize a transaction, providing enhanced multi-signature security for enterprise and institutional custody.

Common multisig configurations:

  • 2-of-3: Any 2 out of 3 designated keys can authorize transactions

  • 3-of-5: Requires 3 out of 5 keys for authorization

  • M-of-N: Customizable threshold requiring M signatures from N total keys

Enterprise use cases:

  • Preventing single points of failure

  • Requiring multiple executives to approve large transfers

  • Separating operational and security responsibilities

  • Implementing maker-checker controls for compliance

MPC Wallets: The Next Evolution

Multi-Party Computation (MPC) wallets represent an advanced approach to key management that eliminates the single private key entirely.

How MPC works:

  1. The private key is never generated as a complete entity

  2. Instead, key shares are distributed across multiple parties

  3. Signatures are computed collaboratively without reconstructing the full key

  4. No single party ever possesses the complete private key

Advantages over traditional multisig:

  • Blockchain-agnostic: Works with any blockchain, not just those supporting multisig

  • Lower transaction fees: Appears as a single signature on-chain

  • Enhanced security: The complete private key never exists in one location

  • Flexible policies: Dynamic approval workflows without on-chain changes

For enterprises managing significant digital assets, MPC-based custody solutions provide institutional-grade security while maintaining operational efficiency.

Key Generation and Storage

Secure key generation:

  • Use cryptographically secure random number generators (CSPRNG)

  • Generate keys in secure, offline environments for high-value applications

  • Never use predictable or low-entropy sources for key material

  • Verify key generation software is from trusted sources

Private key storage options:

  • Hardware Security Modules (HSMs): Tamper-resistant devices for enterprise key storage

  • Hardware wallets: Consumer devices for cryptocurrency private keys, including various non-custodial wallet options

  • Encrypted key files: Software-based storage with strong encryption

  • Paper wallets: Offline storage of keys printed on paper (for cryptocurrency)

Critical rule: Your private key security determines your overall security. If your private key is compromised, all security guarantees are lost.

Key Length and Algorithm Selection

Recommended minimum key lengths (as of 2026):

  • RSA: 2048-bit (3072-bit for long-term security)

  • ECC: 256-bit (384-bit for top secret data)

  • Diffie-Hellman: 2048-bit (3072-bit for long-term security)

Algorithm selection considerations:

  • Performance requirements: ECC offers better performance with smaller keys

  • Compatibility needs: RSA has broader legacy system support

  • Regulatory requirements: Some industries mandate specific algorithms

  • Quantum resistance: Consider post-quantum algorithms for long-term security

Protecting Against Common Attacks

Man-in-the-Middle (MITM) attacks:

  • Always verify certificate authenticity before trusting public keys

  • Use certificate pinning for critical applications

  • Implement mutual TLS authentication for server-to-server communication

  • Monitor for certificate transparency logs

Side-channel attacks:

  • Use constant-time cryptographic implementations

  • Protect against timing attacks through algorithmic design

  • Implement physical security for devices storing private keys

  • Use HSMs that resist power analysis and electromagnetic attacks

Social engineering:

  • Never share private keys under any circumstances

  • Verify certificate fingerprints through independent channels

  • Implement multi-person approval for key management operations

  • Train personnel on phishing and impersonation tactics

Why Quantum Computers Threaten Public Key Cryptography

Shor’s algorithm, discovered by mathematician Peter Shor in 1994, enables quantum computers to efficiently:

  • Factor large numbers (breaking RSA)

  • Solve discrete logarithm problems (breaking ECC and Diffie-Hellman)

A sufficiently powerful quantum computer could break current public key cryptography systems, rendering encrypted data and digital signatures vulnerable.

Timeline considerations:

  • Large-scale quantum computers don’t yet exist

  • Experts estimate 10-20 years before cryptographically relevant quantum computers

  • “Harvest now, decrypt later” attacks: adversaries may be storing encrypted data to decrypt when quantum computers become available

Post-Quantum Cryptography

NIST Post-Quantum Cryptography Standardization has selected quantum-resistant algorithms:

Selected algorithms (2024):

  • CRYSTALS-Kyber: Public-key encryption and key establishment

  • CRYSTALS-Dilithium: Digital signatures

  • FALCON: Digital signatures (compact signatures)

  • SPHINCS+: Digital signatures (stateless hash-based)

Migration strategy:

  • Begin planning post-quantum transitions now

  • Implement crypto-agility in systems to enable algorithm updates

  • Use hybrid approaches combining classical and post-quantum algorithms

  • Prioritize protecting long-term sensitive data

Institutional Custody Requirements

Enterprise digital asset custody demands security beyond consumer-grade solutions. Understanding blockchain custody fundamentals is essential for any organization entering this space.

Regulatory compliance:

  • SOC 2 Type II certification for operational controls

  • ISO 27001 for information security management

  • Compliance with financial services regulations (e.g., MiCA in Europe)

  • Audit trails for all key management operations

Operational security:

  • Segregation of duties for key management

  • Multi-approval workflows for transactions

  • Disaster recovery and business continuity planning

  • Regular security audits and penetration testing

Insurance and liability:

  • Crime insurance covering digital asset theft

  • Errors and omissions coverage

  • Clear liability frameworks for key compromise

  • Third-party security assessments

Choosing an Enterprise Custody Solution

When evaluating crypto custody solutions, organizations must consider multiple factors:

Key evaluation criteria:

  1. Security architecture:

  • MPC vs. multisig vs. HSM-based approaches

  • Key generation and storage mechanisms

  • Encryption standards and protocols

  • Physical and logical access controls

  1. Operational capabilities:

  • Transaction approval workflows

  • API integration options

  • Multi-chain support

  • Staking and DeFi integration

  1. Compliance and governance:

  • Regulatory certifications

  • Audit capabilities and reporting

  • Policy enforcement mechanisms

  • Disaster recovery procedures

  1. Vendor assessment:

  • Track record and reputation

  • Financial stability

  • Customer support and SLAs

  • Technology roadmap and innovation

For organizations managing institutional digital asset custody, solutions like Cobo’s custodial wallet infrastructure provide enterprise-grade security with the flexibility to support complex operational requirements while maintaining the highest security standards.

Secure Web Browsing (HTTPS/TLS)

Every time you visit an HTTPS website, public key cryptography protects your connection:

  1. TLS handshake: Your browser and the server exchange public keys

  2. Certificate verification: Your browser verifies the server’s digital certificate

  3. Session key establishment: Public key cryptography establishes a shared symmetric key

  4. Encrypted communication: Symmetric encryption protects the actual data transfer

This hybrid approach combines the security of public key cryptography with the performance of symmetric encryption.

Email Encryption and Signing

S/MIME (Secure/Multipurpose Internet Mail Extensions):

  • Encrypts email content using recipient’s public key

  • Signs emails with sender’s private key

  • Provides confidentiality, authentication, and non-repudiation

  • Widely supported in enterprise email systems

PGP/GPG (Pretty Good Privacy/GNU Privacy Guard):

  • Decentralized trust model (web of trust)

  • Popular among privacy-conscious users

  • Supports email encryption and file encryption

  • Open-source implementation available

Code Signing and Software Distribution

Code signing certificates use public key cryptography to:

  • Verify software publisher identity

  • Ensure code hasn’t been tampered with since signing

  • Enable operating systems to trust and execute software

  • Provide accountability for software distribution

Application examples:

  • Mobile app distribution (iOS App Store, Google Play)

  • Operating system updates (Windows, macOS, Linux)

  • Browser extensions and plugins

  • Firmware updates for IoT devices

Blockchain and Smart Contracts

Understanding the differences between custodial and non-custodial wallets is essential when working with blockchain applications.

Smart contract platforms like Ethereum use public key cryptography for:

  • Account control: Public keys derive account addresses

  • Transaction authorization: Private keys sign transactions

  • Message signing: Off-chain signatures for gasless transactions

  • Identity verification: Proving ownership without revealing private keys

Emerging applications:

  • Decentralized identity (DID) systems

  • Non-fungible token (NFT) ownership verification

  • Decentralized autonomous organizations (DAOs)

  • Cross-chain bridges and interoperability protocols

Homomorphic Encryption

Homomorphic encryption allows computations on encrypted data without decrypting it:

  • Enables privacy-preserving cloud computing

  • Supports confidential smart contracts

  • Facilitates secure multi-party computation

  • Still computationally expensive but improving

Zero-Knowledge Proofs

Zero-knowledge proofs enable proving knowledge of information without revealing the information itself:

  • zk-SNARKs: Used in privacy-focused cryptocurrencies like Zcash

  • zk-STARKs: Quantum-resistant alternative with no trusted setup

  • Applications: Private transactions, scalability solutions, identity verification

Decentralized Identity and Self-Sovereign Identity

Self-sovereign identity (SSI) uses public key cryptography to give individuals control over their digital identities:

  • Users control their identity data and credentials

  • Verifiable credentials signed by trusted issuers

  • Selective disclosure of identity attributes

  • Interoperable across platforms and services

Threshold Cryptography and MPC

Threshold cryptography continues to evolve:

  • More efficient protocols reducing computational overhead

  • Support for dynamic participant sets

  • Integration with hardware security modules

  • Standardization efforts for interoperability

Public key cryptography represents one of the most important innovations in computer science, enabling secure communication and digital trust in an interconnected world. From securing your web browsing to protecting billions of dollars in digital assets, public key systems form the foundation of modern digital security.

As we move toward a more decentralized future with blockchain technology, AI agents, and Web3 applications, understanding public key cryptography becomes increasingly essential. Whether you’re a developer building decentralized applications, an enterprise managing digital assets, or simply a user concerned about privacy and security, the principles of public key cryptography affect your digital life every day.

For organizations managing cryptocurrency and digital assets, choosing the right custody solution with robust public key infrastructure is critical. Modern solutions like MPC-based custody platforms provide the security, compliance, and operational flexibility required for institutional-scale digital asset management.

The future of public key cryptography will continue to evolve, addressing emerging threats like quantum computing while enabling new applications in privacy, identity, and decentralized systems. By understanding these fundamentals today, you’ll be better prepared for the cryptographic challenges and opportunities of tomorrow.

查看更多

查看收件箱获得最新区块链洞察

Secure your digital assets for free