Public Key Encryption
Public Key Encryption
Introduction
Public Key Encryption is also known as Public Key Cryptography. As we know symmetric key cryptography is useful
for organizations like Governments, Military and Big Financial Corporations but in the last few decades, with the
spread of more unsecure computer networks, it was thought to use cryptography at larger scale. So, the Symmetric
Key Cryptography was found to be non-practical because of changes it faced for key management. Due to this, it
gave rise to Public Key Cryptosystems.
In Public Key Encryption (Public Key Cryptography) two different keys are used to encrypt and decrypt the data.
These two keys are mathematically related. The key are the public key and the private key. They come as pairs.
The Public Key Encryption is also known as Asymmetric Key Encryption as two different keys are used. In Public Key
Encryption, the public key is public to anyone, while the private key belongs to the person who creates these two
keys. The Data encrypted with the public key can only be decrypted with the private key and the data encrypted with
the private key can only be decrypted with the public key.
Here is an example:-
Mikey is sending a message to Sana, they agree to use the public key encryption to encrypt his message. Remember,
the public key encryption to encrypt the sender’s message starts with the receiver, Sana.
First, Sana creates a pair of keys: one is public key and one is private key.
She keeps the private key and gives the public key to Mikey.
After Mikey writes his message he uses public key to encrypt it.
When Sana gets the encrypted document, she uses the private key to decrypt it.
Remember, the public key method to encrypt the sender’s message starts with the receiver, not the sender. The
public key is public to everyone. The Private Key is only known to the receiver.
Here is another example:
Suppose, Sam wants to send an encrypted message to Jessica and they agree to use the public key encryption.
Step 1 : Jessica creates a pair of keys: one public key and one private key. Jessica put the public key in a public key
server which any one can access.
Step 2 : Jessica informs Sam where he can get her public key.
Step 4 : Sam writes a message and uses Jessica’s public key to encrypt it.
Step 6 : Jessica uses her own private key to decrypt Sam’s message.
Although Jessica’s private key can verify no one read or changed the documents in transport, it cannot verify the
sender. Because Jessica’s public key is public. Anyone can use it to encrypt his document and send it to Jessica while
pretending to be Sam.
In order to prove the sender, they need another technique called digital signature.
Public Key Encryption Used In Browsers.
Public Key Encryption is widely used for TLS/SSL which makes HTTPS possible.
Public Key Encryption is beneficial for establishing secure communications over the Internet via HTTPS.
A website’s SSL/TLS certificate, which is shared publicly, contains both the public key and private key installed on the
origin server and it’s owned by the website.
TLS handshakes use public key encryption to authenticate the identity of the origin server, and to exchange data that
is used for generating the session keys. There is a key exchange algorithm, such as RSA or Diffie-Hellman, uses the
public and private key pair to agree session keys, which are used for symmetric encryption once the handshake is
complete. Clients and servers can agree upon new session keys for each communication sessions, so that wrong
persons failed to decrypt communication even if they identify or steal one of the session keys.