asymmetric versus symmetric data encryption

Stella Marley
3 min readFeb 4, 2024

--

A visual representation

Photo by Kaffeebart on Unsplash

1. Introduction

With data encryption, one often hears of the terms symmetric and asymmetric encryption. In this short article, I will try to explain the key differences of these concepts in a visual representation without any unnecessary fluff.

2.. Symmetric encryption

Symmetric encryption uses a symmetric to encrypt data. A symmetric key is a single key and not a key pair.

Flow of symmetric encryption

A visual representation of the flow of symmetric encryption.
  1. The sender of a message (in a real world application often the Back End), will encrypt a message with the key.
  2. The sender sends the encrypted data and key to the receiver.
  3. The receiver decodes the data with the key received at step 2.

Caveats of symmetric encryption

Visible representation of who can encrypt, decrypt and knows the key. Both Receiver and sender know the key, can encrypt and can decrypt in case of symmetric encryption.

This type of encryption is easy since it only requires 1 key, but once an entity knows the key, they are able to encrypt data. This means that if someone grabs a hold of your key, they could pretend to be a valid sender and encrypt false data.

3. Asymmetric encryption

Asymmetric encryption makes use of a key-pair consisting of the following:

  1. private key
  2. public key

The private key is used to encrypt the data and should NOT be shared with the receiver of the data who is in charge of decrypting (often the Front end in web applications).

Flow of asymmetric encryption

  1. The sender encrypts the data with the Private key.
  2. The sender shares the encrypted data and the Public key to the receiver.
  3. The receiver uses the Public key to decrypt the data. They are unaware of the Private key.

Caveats of asymmetric encryption

Asymmetric encryption is more difficult to set up and requires a more complicated application structure. However, it is more secure since the Receiver is unable to encrypt data in this scenario.

Visual representation showing that with assymetric encryption, only the sender can encrypt data

4. Summary

Both symmetric and asymmetric encryption enhance the security of your data. Asymmetric encryption is more secure than symmetric encryption due to the division of public and private keys, but it is a more complicated setup and might not be suited for all applications.

5. Final Words

I hope this guide was useful for you! Please consider buying me a coffee if you have the means to do so :)

--

--

Stella Marley

Web developer living in Japan passionate about code, music, fitness and life in general.