What Is a Public Key?

Written by Coursera Staff • Updated on

Learn what a public key is, how it relates to public key encryption, and when you might need to use one.

[Featued image] A cybersecurity analyst is working from home and is learning about public keys.

Key takeaways

A public key is a type of cryptographic code that encrypts and decrypts sensitive information.

  • A public key, along with its counterpart, a private key, forms the cornerstone of public key cryptography.

  • While a public key encrypts data and is widely accessible, a private key decrypts data and is kept confidential.

  • You can enhance your cybersecurity skills by deepening your understanding of public key encryption.

Discover how a public key works, what it’s used for, and how it contrasts with a private key. Afterward, consider enrolling in the Systems Security Certified Practitioner Specialization to gain proficiency in implementing robust access controls and endpoint security measures.

What is public key cryptography?

A public key is a type of cryptographic code that’s used to encrypt and decrypt sensitive information. “Keys” in cryptography are pieces of information that scramble data so it is uninterpretable without an algorithm specifically designed to unlock the information. A public key, along with its counterpart, a private key, forms the cornerstone of public key cryptography. 

Why are public and private keys important?

Public keys are important because they help protect sensitive information and send it securely. 

For example, imagine sending a confidential letter that’s only intended for the recipient. You might consider sending the letter in a locked box, but you would also have to send the key. However, if someone intercepts your package, they’ll have access to the key and easily unlock the box and read your letter. This is the challenge that public key encryption aims to solve.

With public key encryption, instead of one key, you have two. So, when sending your letter in a locked box, your public key would protect (or encrypt) the box, and only the private key of the recipient can unlock (or decrypt) it. This way, even if someone intercepts your package, they can't open the box without the recipient's private key. The public key ensures your message remains secure during its journey.

Read more: What Is Data Integrity?

What is public key encryption?

Public key encryption, also known as asymmetrical encryption and public key cryptography, is a type of encryption that secures data transfer over the internet. The term “public” means it's openly distributed and accessible to everyone, while the “private” key is known only to the owner. 

Public key vs. private key

A public key is an encryption tool that gets shared widely, and a private key is for decryption and is kept secret.

How is a public key used?

Public keys are commonly used in secure digital information transfers, such as with cryptocurrencies and digital signatures. For a cryptocurrency wallet, the public key acts as an address that people can send cryptocurrency to. It's similar to an email address, but for cryptocurrency. On the other hand, your private key allows you to access and manage your crypto. With it, you can prove the cryptocurrency belongs to you.

Public keys are also used in the creation of digital signatures. Just as you sign a paper document to verify it came from you, a digital signature does the same for electronic documents. Here, the private key creates the signature, and the public key validates it. It guarantees that no one tampered with the message during transit and authenticates the sender's identity.

Related terms

Explore our free cybersecurity career resources

Stay current with popular skills, tools, and certifications with Career Chat on LinkedIn. Strengthen your foundational knowledge of cybersecurity and explore career paths in this field by subscribing to our other free digital resources: 

Accelerate your career growth with a Coursera Plus subscription. When you enroll in either the monthly or annual option, you’ll get access to over 10,000 courses.

Updated on
Written by:

Editorial Team

Coursera’s editorial team is comprised of highly experienced professional editors, writers, and fact...

This content has been made available for informational purposes only. Learners are advised to conduct additional research to ensure that courses and other credentials pursued meet their personal, professional, and financial goals.