What is Encryption and Decryption?

                                      What is Encryption and Decryption?


Encryption is conversion of data from plain text to ciphered text so that it becomes unreadable if fallen into wrong hands. 

Decryption is conversion of the same encrypted data back to plain text. 

There are 2 types of encryption: 

Symmetric Encryption : When we make use of the same key for both encryption and decryption. This is mostly used when data needs to be transferred between closed systems. AES256 algorithm is a common example of this type of encryption.

 Asymmetric Encryption : In asymmetric encryption the sender will use the public key of the receiver to encrypt the data, and the receiver should use their private key to decrypt the data, this private key file should never be shared. This type of encryption should be used while trying to secure a connection with a client and a server. PGP Encryption is a common example of asymmetric encryption. 

What is PGP Encryption? 

PGP(Pretty Good Privacy) is an asymmetric type of encryption which uses public-key cryptography, it is mostly used to encrypt data sent over emails, and to secure connection from sender’s servers to client servers directly via SFTP. It involves digital signature verification to ensure the integrity of that data (to check if the data was not tampered). 

Prerequisites of implementing PGP in Java 

Before we start with the actual implementation, let’s go over the list of prerequisites: Java: Java should be installed in your system. PGP Encryption works with the minimum version of Java8 , but we will be using Bouncy GPG Library, for this Java11 should be working in your system , it will not work with any of the lower versions. 

Java Editor: Any Java editor of your choice should do the trick , I prefer using Eclipse or Spring tool Suite. 

Public Recipient Key : This key should be obtained from the recipient itself.

 Generate public and private key pair: SSH keypair can be generated using ssh-keygen CLI command.

Comments

Popular posts from this blog

Two Sum II - Input Array Is Sorted

Comparable Vs. Comparator in Java

Increasing Triplet Subsequence