Public and private encryption keys | PreVeil (2024)

  • Blog

By: Orlee Berlove, reviewed by Gregg Laroche

Share This

At PreVeil we often find ourselves explaining to our customers the concepts of how public and private keys work. We thought it would be helpful to discuss what these keys are, what they aren’t, and how they work.

The blog below provides a general overview on public and private key pairs rather than an architectural overview of PreVeil. For a detailed understanding of PreVeil’s public-private key architecture, please check out our architectural whitepaper.

How public and private key encryption works

Public and private keys form the basis for public key cryptography , also known as asymmetric cryptography. In public key cryptography, every public key matches to only one private key. Together, they are used to encrypt and decrypt messages. If you encode a message using a person’s public key, they can only decode it using their matching private key.

Public and private keys: an example

Bob wants to send Alice an encrypted email. To do this, Bob takes Alice’s public key and encrypts his message to her. Then, when Alice receives the message, she takes the private key that is known only to her in order to decrypt the message from Bob.

Although attackers might try to compromise the server and read the message, they will be unable to because they lack the private key to decrypt the message. Only Alice will be able to decrypt the message as she is the only one with the private key. And, when Alice wants to reply, she simply repeats the process, encrypting her message to Bob using Bob’s public key.

Public and private encryption keys | PreVeil (2)
More on how public and private keys are used:
Whitepaper: PreVeil Security and Design
Article: End-to-end encryption
Public and private encryption keys | PreVeil (3)

The difference between public and private keys

Public keys have been described by some as being like a business’ address on the web – it’s public and anyone can look it up and share it widely. In asymmetric encryption, public keys can be shared with everyone in the system. Once the sender has the public key, he uses it to encrypt his message.

Each public key comes paired with a unique private key. Think of a private key as akin to the key to the front door of a business where only you have a copy. This defines one of the main differences between the two types of keys. The private key ensures only you can get through the front door. In the case of encrypted messages, you use this private key to decrypt messages

Together, these keys help to ensure the security of the exchanged data. A message encrypted with the public key cannot be decrypted without using the corresponding private key.
Public and private encryption keys | PreVeil (4)

Generating public and private keys

The public and private key are not really keys but rather are really large prime numbers that are mathematically related to one another. Being related in this case means that whatever is encrypted by the public key can only be decrypted by the related private key.

A person cannot guess the private key based on knowing the public key. Because of this, a public key can be freely shared. The private key however belongs to only one person.

There are several well-known mathematical algorithms that are used to produce the public and private key. Some well-respected algorithms include:

  • Rivest-Shamir-Adelman (RSA) – Oldest of the public-private key cryptography systems. Frequently used to transmit shared keys for symmetric key cryptography
  • Digital Signature Standard (DSS) – a Federal Information Processing Standard specifying the algorithms that can be used to generate digital signatures used by NIST
  • Elliptic curve cryptography (ECC)– As its name implies, ECC relies on elliptic curves to generate keys. Often used for key agreement and digital signatures. At PreVeil, we use elliptic-curve cryptography’s Curve-25519 and NIST P-256.

Summary Public key cryptography

Public key cryptography provides the basis for securely sending and receiving messages with anyone whose public key you can access.

Public keys enable:

  • Users to encrypt a message to other individuals on the system
  • You can confirm a signature signed by someone’s private key

Private keys enable:

  • You can decrypt a message secured by your public key
  • You can sign your message with your private key so that the recipients know the message could only have come from you.

Public-private key encryption: Real world examples

Digital signatures

Public and private keys can also be used to create a digital signature. A digital signature assures that the person sending the message is who they claim to be.

Typically, we use the recipient’s public key to encrypt the data and the recipient then uses their private key to decrypt the data. However, using the scheme of digital signatures, there’s no way to authenticate the source of the message. Mike could get a hold of Alice’s public key (since it’s public) and pretend that Bob is the person sending a message to Alice.

To create a digital signature, Bob digitally signs his email to Alice using his private key. When Alice receives the message from Bob, she can verify the digital signature on the message came from Bob by using his public key. As the digital signature uses Bob’s private key, Bob is the only person who could create the signature.

PreVeil’s method for securing messages is a bit more complex than the example provided above. However, the example provides a good general overview for how asymmetric encryption works.
Public and private encryption keys | PreVeil (5)

Diffie-Helman key exchange

The Diffie Hellman key exchange demonstrates an example of how users can securely exchange cryptographic keys over a public channel.

In the past, secure encrypted communication required that the individuals first exchange keys by a secure means such as paper key lists transported by a trusted courier. The Diffie–Hellman key exchange method allows two parties that have no prior knowledge of each other to jointly establish a shared secret key over an insecure channel.

PreVeil uses the Diffie Hellman key exchange to enable Web PreVeil. Web PreVeil is a browser based end-to-end encrypted email service that allows users to easily access their secure email account on the web without any software download or any passwords to remember.

Here’s a video to explain how this works:


Public and private encryption keys | PreVeil (6)

Business benefits of public private key encryption


By using a public and private key for encryption and decryption, recipients can be confident that the data is what the sender says it is. The recipient is assured of the confidentiality, integrity and authenticity of the data.

Confidentiality is ensured because the content that is secured with the public key can only be decrypted with the private key. This ensures that only the intended recipient can ever review the contents

Integrity is ensured because part of the decryption process requires checking that the received message matches the sent message. This ensures that the message has not been changed in between.

Authenticity is ensured because each message sent by Alice to Bob is also signed by Alice’s private key. The only way to decrypt Alice’s private key is with her public key, which Bob can access. By signing the message with her private key, Alice ensures the authenticity of the message and shows that it really did come from her.

Public and private encryption keys | PreVeil (7)

Conclusion

Public and private key pairs form the basis for very strong encryption and data security. If you are interested in reading more about public and private keys, take a look at the following articles:

  • End-to-end encryption
  • Passwordless authentication
  • PreVeil technology

Recent Posts

BlogSeptember 29, 2023Canadian Cybersecurity Program to Align with CMMC FrameworkBlogSeptember 24, 2023A Guide to Understanding the Three CMMC LevelsBlogSeptember 19, 2023Top Cybersecurity Events
Public and private encryption keys | PreVeil (2024)

FAQs

What is public and private key encryption? ›

Public key cryptography is a method of encrypting or signing data with two different keys and making one of the keys, the public key, available for anyone to use. The other key is known as the private key. Data encrypted with the public key can only be decrypted with the private key.

What are public and private SSH keys? ›

An SSH key is used to access a remote server through an SSH connection. The keys come in pairs, a public key and a private key. The public key is kept within the server and the private key is with the user or the client. The server authenticates the user by sending a message encrypted using the public key.

What is private vs public PGP key? ›

PGP uses the public key system in which every user has a unique encryption key known publicly and a private key that only they know. A message is encrypted when a user sends it to someone using their public key, then decrypted when the recipient opens it with their private key.

What is an example of a private key encryption? ›

Private key encryption is often used to encrypt data stored or transmitted between two parties. For example, when you log in to a website using a username and password, the password is often encrypted using a private key before it is transmitted to the web server.

Can public keys decrypt? ›

The power of public key encryption is in that mathematical operation. It's a "one-way function", which means it's incredibly difficult for a computer to reverse the operation and discover the original data. Even the public key cannot be used to decrypt the data.

What is an example of a public key encryption? ›

Here's an example of how public and private keys work together. Bob wants to send Alice an encrypted email. To do this, Bob takes Alice's public key and encrypts his message to her. When Alice receives the message, she uses the matching private key that is known only to her in order to decrypt the message from Bob.

Do I share my public or private SSH key? ›

You keep the private key a secret and store it on the computer you use to connect to the remote system. Conceivably, you can share the public key with anyone without compromising the private key; you store it on the remote system in a .ssh/authorized_keys directory.

How to generate a public key? ›

To generate an SSH private/public key pair for your use, you can use the ssh-keygen command-line utility. You can run the ssh-keygen command from the command line to generate an SSH private/public key pair. If you are using Windows, by default you may not have access to the ssh-keygen command.

Can one private key have multiple public keys? ›

It's actually possible to generate several public keys from the same private key. However, you'll only ever have one private key. And while it's theoretically possible to guess or calculate the public key from the private key, the reverse would take hundreds of years to crack.

What is the difference between a private key and a secret key? ›

A private key is a secret key that is shared between two parties in symmetric cryptography and is only kept by one party in asymmetric cryptography. A private key can be used to decrypt information encrypted with the corresponding public key as well as used to create the digital signature of a file or certificate.

What is a public private key in SSL? ›

These keys are a linked pair of text files and are created together as a pair when you create your Certificate Signing Request (CSR). SSL works by making one key of the pair (the public key) known to the outside world, while the other (the private key) remains a secret only you know.

What is public API key vs private key? ›

There are two main types of API keys: Public API keys: These are usually generated by the owner of the application and made available to developers or users. They allow developers to access public data or features of an application. Private API keys: Private keys are used in server-to-server communications.

What is public key and private key with an example? ›

A public key is an encryption method that uses a pair of private and public keys to secure data communication. First, the public key encrypts the plain text, converting it into ciphertext, then the private key is used for decrypting the converted ciphertext so the recipient can read the message.

What does a private key look like? ›

A private Bitcoin key is a 64-character string of letters and numbers. It might look something like this: E9873D79C6D87DC0FB6A5778633389F4453213303DA61F20BD67FC233AA33262.

What is a public key used for? ›

A mathematical key that has public availability and that applications use to verify signatures created with its corresponding private key. Depending on the algorithm, public keys can encrypt messages or files that the corresponding private key can decrypt.

What is public and private key in SSL certificate? ›

When performing authentication, SSL uses a technique called public-key cryptography. Public-key cryptography is based on the concept of a key pair, which consists of a public key and a private key. Data that has been encrypted with a public key can be decrypted only with the corresponding private key.

What are the two types of public key encryption? ›

RSA and ElGamal Schemes – A Comparison
RSAElGamal
It is less efficient for decryption.It is more efficient for decryption.
For a particular security level, lengthy keys are required in RSA.For the same level of security, very short keys are required.
It is widely accepted and used.It is new and not very popular in market.
1 more row

What is public key vs private key TLS? ›

The TLS client uses the public key from the server's certificate to encrypt the generated symmetric key. The TLS client sends the encrypted symmetric key to the TLS server. The TLS server uses its own private key to decrypt the received encrypted symmetric key.

What is the public key encryption in CIA? ›

Asymmetric algorithms use two keys: a public key and a private key. The sender uses the public key to encrypt a message, and the receiver uses the private key to decrypt it. The public key can be truly public or it can be a secret between the two parties.

Top Articles
Bachelor's in Finance and Master's in Finance Programs
10 Best Non-Lethal Self Defense Weapons
Great Clips Mount Airy Nc
Oldgamesshelf
Craigslist Home Health Care Jobs
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
Trevor Goodwin Obituary St Cloud
What spices do Germans cook with?
Lamb Funeral Home Obituaries Columbus Ga
Jonathon Kinchen Net Worth
Gabriel Kuhn Y Daniel Perry Video
Botanist Workbench Rs3
35105N Sap 5 50 W Nit
Tap Tap Run Coupon Codes
Poplar | Genus, Description, Major Species, & Facts
Needle Nose Peterbilt For Sale Craigslist
414-290-5379
Readyset Ochsner.org
Dumb Money
Where does insurance expense go in accounting?
This Modern World Daily Kos
Bfg Straap Dead Photo Graphic
Ruben van Bommel: diepgang en doelgerichtheid als wapens, maar (nog) te weinig rendement
Why Is 365 Market Troy Mi On My Bank Statement
Silive Obituary
Why Does Lawrence Jones Have Ptsd
SN100C, An Australia Trademark of Nihon Superior Co., Ltd.. Application Number: 2480607 :: Trademark Elite Trademarks
Encyclopaedia Metallum - WikiMili, The Best Wikipedia Reader
Essence Healthcare Otc 2023 Catalog
Bolsa Feels Bad For Sancho's Loss.
Black Panther 2 Showtimes Near Epic Theatres Of Palm Coast
Unreasonable Zen Riddle Crossword
HP PARTSURFER - spare part search portal
Earthy Fuel Crossword
Syracuse Jr High Home Page
Pch Sunken Treasures
Minecraft Jar Google Drive
How does paysafecard work? The only guide you need
Wednesday Morning Gifs
Missouri State Highway Patrol Will Utilize Acadis to Improve Curriculum and Testing Management
About Us | SEIL
Rochester Ny Missed Connections
The Listings Project New York
Craigslist Com Panama City Fl
Doe Infohub
Why Are The French So Google Feud Answers
Fatal Accident In Nashville Tn Today
What is 'Breaking Bad' star Aaron Paul's Net Worth?
Jimmy John's Near Me Open
Philasd Zimbra
Factorio Green Circuit Setup
Latest Posts
Article information

Author: Lidia Grady

Last Updated:

Views: 5790

Rating: 4.4 / 5 (65 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Lidia Grady

Birthday: 1992-01-22

Address: Suite 493 356 Dale Fall, New Wanda, RI 52485

Phone: +29914464387516

Job: Customer Engineer

Hobby: Cryptography, Writing, Dowsing, Stand-up comedy, Calligraphy, Web surfing, Ghost hunting

Introduction: My name is Lidia Grady, I am a thankful, fine, glamorous, lucky, lively, pleasant, shiny person who loves writing and wants to share my knowledge and understanding with you.