# How GPG works: Encrypt

DevFeed: [How GPG works: Encrypt](<https://devfeed.tech/articles/how-gpg-works-encrypt-35415.md>)

Original publisher: [Read original article](<https://darkcoding.net/software/how-gpg-works-encrypt/>)

Author: Graham King

Published: 2013-07-30T21:02:43Z

Content type: tutorial

Language: en

Sources: [Graham King](<https://devfeed.tech/sources/graham-king.md>)

Topics: [Encryption](<https://devfeed.tech/topics/encryption.md>), [Cryptography](<https://devfeed.tech/topics/cryptography.md>), [public key](<https://devfeed.tech/topics/public-key.md>), [private key](<https://devfeed.tech/topics/private-key.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>)

Tags: [command-line](<https://devfeed.tech/tags/command-line.md>), [cryptography](<https://devfeed.tech/tags/cryptography.md>), [decrypt](<https://devfeed.tech/tags/decrypt.md>), [encryption](<https://devfeed.tech/tags/encryption.md>), [file](<https://devfeed.tech/tags/file.md>), [guide](<https://devfeed.tech/tags/guide.md>), [private-key](<https://devfeed.tech/tags/private-key.md>), [public-key](<https://devfeed.tech/tags/public-key.md>), [rsa](<https://devfeed.tech/tags/rsa.md>), [signing](<https://devfeed.tech/tags/signing.md>), [software](<https://devfeed.tech/tags/software.md>)

## AI overview

A straightforward guide to how GPG encrypts messages: it generates a random session key, encrypts the file with a symmetric cipher, and encrypts the session key with each recipient's public key. It also explains that the passphrase protects the private key rather than encrypting the message itself.

## Source excerpt

Demystifying GPG encryption: A straightforward guide to the process.