How to Choose the Best Encryption Methods for Databases

Introduction

Encryption is the process of encoding messages or information so that only authorized parties can see it. Encryption has been going on for centuries. For example, in World War II Allied forces were sending out encrypted codes using the unwritten Navajo language, which was impossible for the Japanese to decode.

Today encryption is even more important because we live in an era where privacy and security are constantly under attack from hackers who want access into our personal lives. Thanks to modern technology like AES encryption, there's no reason why hackers should read sensitive information.

Using Server-Side Encrypt Data AWS KMS to Integrate With Mule-4 AWS-S3 Connector

Purpose

To Demonstrate MuleSoft integration with S3 Bucket with enabled KMS (Server Side Encryption).

Table of Contents

  • What is AWS KMS?
  • Key Rotation; AWS configuration for KMS and S3 Bucket.
  • Mule 4 connector configuration.
  • Tutorial video.

Scenarios

  • Publish data to the S3 bucket while the bucket is enabled with server-side encryption.
  • Publish data to the S3 bucket as the bucket is disabled with server-side encryption.

What Is AWS KMS?

AWS Key Management Service (AWS KMS) is a regulated service that makes it easy to produce and manage the encryption keys utilized to encrypt data.

Implementation of Hybrid Encryption Using Java 1.8 and OpenSSL

Symmetric encryption is a type of encryption in which a single key is used to both encrypt and decrypt the data. Whereas in asymmetric encryption approach public/private key pair is used to do the same. This rules out the risk of mishandling of the key as the public key is only shared with the clients and the private key is kept secret. Client can encrypt the data with the key and send the data securely over any standard data sharing protocols. At the receiver end, the private key is used to decrypt the data.

But the time to encrypt the data with asymmetric encryption grows significantly proportionately with the size of data. Here symmetric encryption does the job quite efficiently.

Encryption, Part 1B: Symmetric Encryption of Voluminous Files

In my recent article, Encryption Part 1: Symmetric Encryption, I covered the symmetric encryption of data and shared example Java code.

The method I covered in that article operates on the complete data/string. Obviously, this method is not suitable when dealing with voluminous files — MBs, GBs, TBs — particularly in the world of Big Data. Ideally, I should have also shared the code to encrypt and decrypt voluminous files, which I am doing in this article.

Encryption, Part 2: Public Key/Private Key Encryption

In my previous article, I presented the concept of symmetric encryption, where the same key is used to encrypt and decrypt data. The biggest limitation of symmetric encryption is the key itself. The key used for encryption and decryption has to be kept a secret. If the key is compromised, the encrypted data is no longer secure. While you may feel that it will be easy to keep the key safe, consider the fact that the same key cannot be used to encrypt data between multiple parties. For example, if Alice and Bob agree to use a secret key X for exchanging their messages, the same key X cannot be used to exchange messages between Alice and Jane. This is because such messages can be decrypted by Bob as well. Hence, in addition to keeping the key a secret, each pair that wishes to communicate secretly will have to maintain a key for their conversation.

This problem is overcome by the concept of public key/private key encryption (also known as Public Key Encryption or PKE for short).