DEV Community

Cover image for PGP - Introduction Encryption and Decryption (Part 1)
Humberto Arroyo
Humberto Arroyo

Posted on

PGP - Introduction Encryption and Decryption (Part 1)

Summary

  • Encryption converts plaintext into ciphertext.
  • PGP is used for signing, encrypting, and decrypting information.
  • Decryption converts encrypted data into original form.

In cryptography, encryption is the process of encoding information. This process converts the original representation of the information(plaintext) into an alternative form known as ciphertext.

Decryption is the conversion of encrypted data into original form. It is generally a reverse process of encryption.

Pretty Good Privacy (PGP) is an encryption program that provides cryptographic privacy and authentication for data communication. PGP is used for signing, encrypting, and decrypting data(texts, e-mails, files, directories, and whole disk partitions and to increase the security of e-mail communications) and allow us send and receive files securely.

PGP and similar software follow the OpenPGP, an open standard of PGP encryption software, standard (RFC 4880) for encrypting and decrypting data.

Use case

Ana and John are two people that want to exchange messages

  1. Ana wants to send a private message
  2. John generates a public and a private key
  3. John keeps the private key and send back to Ana his public key
  4. Ana encrypts her message using John's public key
  5. Ana sends to John the encrypted message
  6. John decrypts the encrypted message with his private key

Encryption and Decryption

  • Important: If John(recipient) wants to receive encrypted message, it must generate key pair.

Top comments (0)