Modern Big Data Processing with Hadoop
上QQ阅读APP看书,第一时间看更新

Encryption

This is the process of changing a given text to some other form by using some form of secret. These are mathematically defined functions:

As you can see, these functions take an input and a secret and generate data that can be decrypted using the same secret and the output:

If we observe carefully, it is the secret that is playing an important role here. In cryptography, there are two types of algorithms that are available based on this secret. The usage of these depends on the situation and the secret transportation challenges.

Without going too deep into cryptography, let's try to understand what these methods are:

  • Symmetric key encryption
  • Asymmetric key encryption

The basic difference between the two is that in the first one, we use the same secret for both encryption and decryption. But in the latter, we use two different keys for encryption and decryption.

Let's take a look at a few examples of symmetric key encryption in action:

Algorithm

Input Data

Output Data

Method

ROT13

hello

uryyb

Encryption

uryyb

hello

Decryption

DES

hello

yOYffF4rl8lxCQ4HS2fpMg==

Encryption (secret is hello)

yOYffF4rl8lxCQ4HS2fpMg==

hello

Decryption (secret is hello)

RIJNDAEL-256

hello

v8QbYPszQX/TFeYKbSfPL/
rNJDywBIQKtxzOzWhBm16/
VSNN4EtlgZi3/
iPqJZpCiXXzDu0sKmKSl6IxbBKhYw==

Encryption (secret is hello)

v8QbYPszQX/TFeYKbSfPL/
rNJDywBIQKtxzOzWhBm16/
VSNN4EtlgZi3/
iPqJZpCiXXzDu0sKmKSl6IxbBKhYw==

hello

Encryption (secret is hello)

 

As you can see, the data that is generated varies in both complexity and length depending on the encryption algorithm we use. It also depends on the secret key that is used for encryption.

Encryption poses a challenge of more computational requirements and storage space. We need to plan our system accordingly if we want to use encryption as one of the methods in the masking process.