Skip to main content

Blog/Online Security ABC/

What is public key encryption?

Joanna

Senior Copywriter

The words 'Public key encryption' in white text on a dark green background. Below the text are two square digital icons: one turquoise with an eye, and one light gray with a key.

In business, trust is everything. But how do you build that trust in a digital world to protect transactions, secure data, and verify identities? The answer lies in a cornerstone of modern cybersecurity: public key cryptography.

Public key encryption uses two different keys. The public key encrypts data, and the private key decrypts it. Think of your public key like your business's public-facing mail slot. Anyone can use it to drop off a locked package—that is, data—for your eyes only. But that package can only be opened once it's safely inside. Your private key is the unique key to the front door, ensuring only you can get in to retrieve that information.

This powerful two-key system secures transactions, protects customer data, and verifies digital identities online. Let's explore how these keys work together.

How does public key encryption work?

As we've mentioned, public key encryption relies on a matched pair of keys to secure data. While we call them "keys," they are actually large numbers that are mathematically linked together.

This link is a one-way street: data encrypted with a public key can only be decrypted by its matching private key. It's impossible to figure out the private key just by looking at the public one, which is why the public key can be shared openly without risk.

A great practical example is when a client must upload sensitive financial documents to their accounting firm's secure online portal.

  • Encryption: When the client clicks “Upload,” their browser automatically uses the firm's public key (which is openly available on the server) to encrypt the documents. The files are now scrambled into unreadable ciphertext.

  • Transmission: The encrypted files then travel securely over the internet. Even if a hacker intercepted them, they would only see gibberish because they don't have the private key.

  • Decryption: Once the files arrive at the firm's server, it uses its private key—which is kept secret and secure—to decrypt the documents, making them readable and ready for use.

This one-way process ensures that, even if an encrypted message is intercepted, only the intended recipient with the correct private key can read its contents.

Applications of public key cryptography 

Let’s now explore where public key cryptography is used. As it's the backbone of digital trust, it works behind the scenes in many of the tools your business relies on daily.

Securing websites (HTTPS)

That padlock icon in your browser is powered by public key cryptography via the SSL/TLS certificates. These protocols use public key encryption for exchanging symmetric session keys between a browser and a server. 

When you connect to a secure website, its certificate provides your browser with a public key. Your browser uses this to verify the website's identity and then securely negotiate a temporary, one-time-use symmetric key that encrypts all the data for the remainder of your session.

Digital signatures

A digital signature acts as a tamper-proof seal to verify a document's origin and integrity. The sender uses their own private key to create a unique signature for a file. Anyone can then use the sender's public key to confirm that the signature is authentic and that the document hasn't been altered. 

Secure email communication

Technologies like Pretty Good Privacy (PGP) use public key encryption to keep emails confidential. To send a secure email, you encrypt it with the recipient's public key. This ensures that only the recipient, using their corresponding private key, can decrypt and read the message's contents.

Public key encryption algorithms 

Public key encryption is pure mathematics. Special algorithms create the public and private key pairs based on mathematical problems that are easy to perform in one direction but nearly impossible to reverse.

Think of it like mixing two secret paint colors to create a new one. It's simple to mix them, but incredibly difficult for anyone to figure out the original secret colors just by looking at the final result. 

Rivest-Shamir-Adleman (RSA)

The security of this long-standing industry standard comes from the difficulty of factoring large numbers. RSA multiplies two massive, secret prime numbers to generate a public key. While multiplying them is easy, it's computationally infeasible for an attacker to reverse the process and discover the original secret numbers, keeping the private key safe.

Elliptic Curve Cryptography (ECC)

It’s a more modern and efficient algorithm that has become very popular. It provides the same level of security as RSA but with much smaller key sizes. This means it requires less computing power and is significantly faster, making it ideal for mobile devices, IoT, and modern web performance.

Unlike “old school” approaches, EEC uses public and private keys. Its encryption and decryption are based on Diffie-Hellman key exchange and symmetric encryption, such as the one used in the RSA, enabling better performance.

Diffie-Hellman key exchange

This algorithm solves a different but related problem: how can two parties who have never met create a shared secret key over an insecure network? Using a clever mathematical process, both sides can independently calculate the same secret key without ever sending the key itself. 

In short, algorithms like RSA create the keys, while Diffie-Hellman helps exchange them. Each plays a key role in building the layers of trust for digital communication.

Symmetric vs. asymmetric encryption 

While public key (asymmetric) encryption is powerful, it often works hand-in-hand with another method: symmetric encryption. Understanding both is key to seeing the full picture of modern security.

Symmetric encryption: the racecar 

Symmetric encryption uses a single shared key to lock (encrypt) and unlock (decrypt) data. Think of it like a traditional key to a safe; anyone with a copy of the key can open it.

  • Strength: Symmetric encryption is fast and efficient, making it perfect for encrypting large amounts of data.

  • Considerations: The main concern for this method is sharing the key securely. Since the same key locks and unlocks the data, you need a secure way to get it to the recipient. This is why it excels at protecting data at rest or working as part of a team with asymmetric encryption.

A good example is the Advanced Encryption Standard (AES), a symmetric block-cipher algorithm or XChaCha20 stream-cipher algorithm NordPass uses to encrypt your vault data.

Asymmetric encryption: the armored truck 

As we've discussed, asymmetric encryption, also known as public key encryption, uses a key pair: a public key to lock data and a private key to unlock it.

  • Strength: It brilliantly solves the key exchange problem, since the private key is never shared.

  • Considerations: This powerful encryption comes with a trade-off. It requires more computing power, making the process slower than symmetric encryption. Asymmetric encryption works best for securely exchanging small amounts of critical data or a symmetric key, thus solving the key-exchange problem.

The hybrid approach: how they work together

So, how do you get the ironclad security of an armored truck and the high speed of a racecar? You use them together. This hybrid approach is the foundation of secure web connections (TLS/SSL).

  1. The handshake (asymmetric): When your browser connects to a secure website (https://), it uses slow but secure asymmetric encryption (the armored truck) to safely agree on a brand-new, one-time-use symmetric key.

  2. The communication (symmetric): Once both sides have this shared secret key, they switch to the fast and efficient symmetric encryption (the racecar) to protect all the actual data exchanged during the session.

This method gives you the best of both worlds: the high security of asymmetric encryption for the initial key exchange and the high speed of symmetric encryption for all ongoing communication.

Is public key encryption really safe?

Yes, its two-key design makes it fundamentally more secure for communicating over open networks than single-key methods. However, its safety depends on two things: verifying key ownership and protecting the private key.

But this creates a new question: how do you know a public key really belongs to the person you think it does? Without a way to verify ownership, an attacker could trick you in a man-in-the-middle (MITM) attack by substituting their own public key for a legitimate one.

This is where digital certificates and a public key infrastructure (PKI) come in. A digital certificate, issued by a trusted certificate authority (CA), acts as a digital passport. It officially binds an identity to a public key, proving it's authentic and shutting down the possibility of an MITM attack.

Will quantum computers make public key encryption obsolete?

Theoretically, yes. Powerful quantum computers could break the public-key encryption we rely on today. Symmetric encryption, however, would only be weakened, not broken, and remain secure.

This threat is not immediate. Breaking modern encryption requires millions of quantum bits (qubits), but today’s most advanced computers only have a few hundred. It will likely take decades to close this gap.

In response, cybersecurity experts are already developing new, quantum-resistant algorithms known as post-quantum cryptography (PQC). The takeaway for businesses is simple: don't panic, but start planning for a post-quantum future.

Secure your business with NordPass 

Does your team juggle hundreds of credentials and passwords every single day? That’s where digital trust gets complicated—and where risk creeps in.

NordPass helps you tame that chaos. We give you one secure place to manage it all, built on a zero-trust framework so your data stays yours, period. This turns your compliance checklist for standards like SOC 2 and GDPR from a headache into a simple box to tick.

So, what’s the right fit for you?

  • For growing teams: NordPass Business is your new command center. You’ll get a bird's-eye view of your company's password health and finally have a simple, secure way to share credentials.

  • For larger organizations: NordPass Enterprise plugs right into your tech stack. Think automated User Provisioning and integrations with your existing SIEM and SSO tools. It’s security that works with you, not against you.

Don’t let credentials be your weak link. Make every digital connection a secure one. Contact us today to learn how NordPass can help.