Fact-checked by Grok 2 weeks ago

GNU Privacy Guard

GNU Privacy Guard (GnuPG) is a free, open-source implementation of the OpenPGP standard (RFC 4880) that enables users to encrypt, sign, and verify data and communications to protect privacy and authenticity. Developed as part of the GNU Project under the GNU General Public License, GnuPG serves as a complete replacement for the proprietary (PGP) software suite, providing versatile key management, support for public key directories, , and integration with (SSH). It is widely used for securing emails, files, and software distributions, with command-line tools, libraries, and graphical frontends available across multiple platforms including Windows, , and macOS. Initiated by Werner Koch in 1997 as "g10" to avoid patented algorithms like RSA and IDEA, GnuPG was renamed and released under its current name in early 1998, with an initial OpenPGP draft-compliant version later that year and full compliance achieved with version 1.0.0 in 1999. The first stable version, 1.0.0, arrived in September 1999, accompanied by the GNU Privacy Handbook, while the modern GnuPG-2 series began with version 2.0.0 in 2006, introducing enhanced features like S/MIME support. As of November 2025, the latest stable release is version 2.4.8 (May 2025), with the current development release at version 2.5.13 (October 2025) and ongoing development ensuring compatibility and security updates. GnuPG's key features include asymmetric encryption using algorithms such as ElGamal and , digital signatures for integrity verification, and a robust system for generating, revoking, and exchanging public keys via keyservers. It counters bulk surveillance by enabling and is integral to tools like for Windows and GPG Suite for macOS, promoting secure communication in an era of increasing data threats. Maintained primarily by Koch with contributions from developers like David Shaw, GnuPG remains a cornerstone of , trusted by individuals, organizations, and governments worldwide.

Introduction

Overview

GNU Privacy Guard (GnuPG or GPG) is a free and open-source software implementation of the OpenPGP standard, serving as a replacement for the proprietary Pretty Good Privacy (PGP) cryptographic software suite. Developed by Werner Koch, it was initially released in 1997 to provide accessible tools for data encryption and authentication without the export restrictions that limited PGP's availability. GnuPG complies with RFC 4880, the OpenPGP Message Format standard, ensuring interoperability with other compliant systems for secure communication. The primary purpose of GnuPG is to enable users to protect the and integrity of their data and communications, particularly in countering and unauthorized access. It supports essential cryptographic operations, including the and decryption of emails and files, as well as the and of digital signatures to authenticate messages and documents. Additionally, GnuPG facilitates , management, and exchange, allowing users to establish secure channels for sharing sensitive information. At its core, GnuPG includes the gpg command-line tool, which implements hybrid encryption schemes—using to protect symmetric session keys and symmetric algorithms to encrypt the bulk data itself. The software is distributed under the GNU General Public License (GPL), permitting free use, modification, and redistribution while ensuring that derivative works remain . Some associated libraries, such as those in the GnuPG-related ecosystem, may use the GNU Lesser General Public License (LGPL) to support integration into broader applications.

Design Principles

GNU Privacy Guard (GnuPG) is developed as part of the GNU Project by the (FSF), adhering strictly to the principles of that emphasize user freedoms to run, study, share, and modify the program. This commitment ensures that the source code is always available and licensed under the GNU General Public License (GPL), promoting unrestricted redistribution and community-driven improvements without proprietary restrictions. A core design principle of GnuPG is full compliance with the OpenPGP standard (RFC 4880), enabling seamless interoperability with other OpenPGP-compliant tools, including legacy PGP implementations. This standards-based approach allows users to exchange encrypted messages and keys across diverse systems without compatibility issues, prioritizing long-term usability over vendor-specific features. Following disagreements in the IETF OpenPGP Working Group leading to the publication of RFC 9580 in 2024, GnuPG's developers proposed the LibrePGP draft (as of 2025) as an alternative update, while maintaining with RFC 4880-based systems. GnuPG employs a modular to separate from higher-level operations, with the core library providing reusable building blocks for , hashing, and that can be integrated into other applications. Written primarily in portable ISO C, the software avoids proprietary dependencies, ensuring it compiles and runs on a wide range of platforms including systems, Windows, and macOS without requiring non-free components. Embracing , GnuPG focuses on a lightweight as its primary mode of operation, with graphical user interfaces available as optional frontends to maintain simplicity and reduce . Network-related functions, such as accessing keyservers, are delegated to the separate Dirmngr daemon, keeping the core executable free from direct internet connectivity and enhancing security through isolation of concerns.

Technical Specifications

Cryptographic Algorithms

GNU Privacy Guard (GnuPG) implements a range of cryptographic algorithms specified in the OpenPGP standard, primarily drawing from RFC 4880 and its updates in RFC 9580, to support , digital signatures, and integrity protection. These algorithms are provided through the library, ensuring compatibility with OpenPGP while favoring secure, unencumbered options. GnuPG deprecates weak algorithms like for hashing and IDEA for symmetric , aligning with RFC 9580 recommendations to avoid generating new instances of these.

Public-Key Algorithms

GnuPG supports several public-key algorithms for asymmetric operations such as encryption and signing. (Rivest-Shamir-Adleman) is implemented with key sizes ranging from 1024 to 4096 bits, suitable for both encryption and signing in combined or separate modes. (Digital Signature Algorithm) is supported for signing with key sizes from 1024 to 3072 bits, adhering to FIPS 186 standards. ElGamal is available for encryption-only operations with key sizes of 2048 to 4096 bits, though its use is deprecated in newer OpenPGP versions per 9580. For elliptic curve cryptography (ECC), GnuPG incorporates support via Libgcrypt since version 2.1, including for (Edwards-curve Digital Signature Algorithm) signatures and ECDH (Elliptic Curve Diffie-Hellman) encryption, as defined in RFC 6637. NIST P-curves (e.g., P-256, , P-521) are also supported for ECDSA and ECDH, with fixed curve sizes per the standards. These ECC algorithms use 256-bit or larger equivalents for security comparable to 3072-bit .

Symmetric Ciphers

Symmetric encryption in GnuPG relies on block ciphers operating in Cipher Feedback (CFB) mode, as mandated by OpenPGP for compatibility. AES (Advanced Encryption Standard) variants are preferred, including AES-128, AES-192, and AES-256 with corresponding key sizes. CAST5 (also known as CAST-128) uses 128-bit keys and remains supported for backward compatibility. Twofish is implemented with key sizes of 128, 192, or 256 bits, offering an alternative unencumbered option. Triple-DES (3DES) with 168-bit effective key strength is available but deprecated due to vulnerabilities.

Hash Algorithms

Hash functions in GnuPG are used for message digests, signature verification, and key derivation. (Secure Hash Algorithm 1) with 160-bit output is supported for legacy compatibility but discouraged for new signatures. Modern family algorithms include (256-bit), (384-bit), and (512-bit), which are recommended for their collision resistance. RIPEMD-160, producing 160-bit digests, is also implemented as an alternative to . is deprecated and must not be used for new operations.

Compression Algorithms

To reduce message size and enhance security through data obfuscation, GnuPG applies before or signing. The supported algorithms include (based on ), ZLIB ( 1950), and , with as the default preference in OpenPGP packets. Uncompressed mode is also available for cases where is unnecessary.

Key Derivation

Passphrase-based key derivation in GnuPG employs the String-to-Key (S2K) mechanism from OpenPGP, which uses a salted and iterated hash to produce symmetric keys resistant to brute-force attacks. Simple S2K performs a single hash iteration on the passphrase concatenated with an 8-byte salt, while iterated and salted variants apply up to 65,536 iterations using hash algorithms like SHA-1 or SHA-256. RFC 9580 introduces Argon2 as an optional S2K specifier (ID 4) for memory-hard derivation, though GnuPG primarily uses iterated hashing for compatibility. This process protects private keys and enables symmetric encryption without public keys.

Key Management

Key generation in GnuPG involves creating public-private key pairs using commands such as gpg --gen-key, gpg --full-generate-key, or gpg --quick-generate-key. Users can specify key types like RSA, DSA, ElGamal, Ed25519, or Curve25519, with bit sizes such as 4096 for RSA to enhance security. Options include setting key expiration dates in formats like YYYY-MM-DD or relative units such as 1y for one year, or never for indefinite validity. Subkeys can be added post-generation using gpg --quick-add-key for specific purposes like encryption (encr) or signing (sign), allowing the primary key to focus on certification while subkeys handle operations to limit exposure. Keyrings in GnuPG store cryptographic keys locally in the ~/.gnupg by default, which can be overridden via the GNUPGHOME or --homedir option. keys are maintained in pubring.kbx (introduced in GnuPG 2.1 for improved with large collections), replacing the pubring.gpg . Private keys are separated for and stored in the private-keys-v1.d subdirectory as individual files starting from GnuPG 2.1, eliminating the former secring.gpg file and integrating management with the gpg-agent. This separation ensures keys can be freely shared while private keys remain protected. GnuPG supports multiple trust models to validate key authenticity during cryptographic operations. The model, a decentralized approach, relies on users signing each other's keys and assigning trust levels to build chains of validation, configurable via --trust-model pgp or --trust-model classic. In contrast, the (Trust On First Use) model, an experimental option enabled with --trust-model tofu, memorizes the first encountered key for a given (e.g., ) and prompts for confirmation on subsequent mismatches, using policies like auto or ask to handle bindings. Centralized models include direct, where users manually assign validity, or always, which assumes all keys are trustworthy without checks. Key exchange facilitates distribution of public keys through export and import operations. Public keys can be exported in ASCII-armored format using gpg --export --armor <keyid> > key.asc for easy sharing via email or text. Import is performed with gpg --import key.asc, integrating the key into the local keyring. For broader distribution, GnuPG interacts with keyservers via options like --keyserver hkp://keys.gnupg.net, allowing receipt with gpg --recv-keys <keyid> or sending via gpg --send-keys <keyid>. Revocation ensures compromised or outdated can be invalidated. Users generate using gpg --gen-revoke <keyid>, which produces an ASCII-armored file specifying reasons like key compromise or supersession. To revoke, import the with gpg --import revoke.asc, marking the as revoked in the keyring. For compromised , the should be published promptly to keyservers using --send-keys to notify others and prevent further use. Passphrase handling in GnuPG 2.x is managed by the gpg-agent, which caches s securely to avoid repeated entry during sessions. The agent prompts for the via pinentry tools when accessing private keys and stores it in memory, with lifetime configurable via default-cache-ttl in gpg-agent.conf. This integration reduces friction in key operations while maintaining security through options like --pinentry-mode [loopback](/page/Loopback) for scripted use.

Message Formats

GNU Privacy Guard (GnuPG) implements the OpenPGP message format, a standardized structure for handling encrypted, signed, and compressed data through a sequence of packets. Each packet consists of a tag indicating its type, a length specifier, and the packet's body, allowing modular construction of messages that support among compliant implementations. This format enables operations such as , signing, and protection while maintaining flexibility for various use cases. Central to encrypted messages are specific packet types that facilitate secure data transmission. Public-Key Encrypted Session Key Packets (type 1) encapsulate a symmetric encrypted under the recipient's public key, using algorithms like or ElGamal. Symmetric-Key Encrypted Session Key Packets (type 3) store session keys encrypted with a passphrase-derived symmetric key, useful for scenarios without public keys. For the payload, Symmetrically Encrypted Packets (type 9) or the more secure Symmetrically Encrypted Protected Data Packets (type 18) hold the encrypted message content, often employing ciphers such as . Signature Packets (type 2) contain digital signatures over data or keys, generated with algorithms like or ECDSA, including hashed and unhashed subpackets for like timestamps and issuer IDs. One-Pass Signature Packets (type 4) precede the signed data, enabling efficient streaming verification by specifying the signature's key ID, hash algorithm, and public-key algorithm without buffering the entire message. GnuPG employs a hybrid encryption scheme to balance security and performance in message . A random symmetric is generated for the payload, which is then encrypted using a fast symmetric algorithm. This is separately encrypted with the recipient's public key via an asymmetric algorithm and included as a Public-Key Encrypted Packet. The resulting message combines the encrypted packet(s) with the symmetrically encrypted data packet, allowing recipients to decrypt the first and then the payload. This approach leverages the strengths of both paradigms: the benefits of and the speed of symmetric for large data. To ensure safe transport across text-only channels like , GnuPG supports ASCII armoring of OpenPGP messages. Armoring converts the binary packet stream into printable ASCII using radix-64 () encoding, with a cyclical redundancy check (CRC-24) for . Messages are framed by headers such as -----BEGIN PGP MESSAGE----- for encrypted or signed data, followed by the encoded content and a matching footer like -----END PGP MESSAGE-----. Optional version and comment lines provide additional context, making armored messages human-readable and compatible with systems that might alter . Signing in GnuPG accommodates diverse needs through multiple modes. Detached signatures produce a standalone Signature Packet verifiable against a separate , ideal for . Inline signed messages integrate the original , a One-Pass Signature Packet, and a trailing Signature Packet into a single structure, preserving the while embedding material. For textual content, clearsigning generates a format where the signed body remains unmodified and readable, bounded by signature delimiter lines like -----BEGIN PGP SIGNED MESSAGE-----, with the actual Signature Packet appended in armored form at the end. These modes support both and text , with hashes computed over the literal representation. Compression is seamlessly integrated into the OpenPGP message pipeline in GnuPG, typically applied before signing or to minimize transmission size without compromising . A Compressed Data Packet (type 8) wraps the subsequent packets, using algorithms like or ZLIB to the content. This step occurs after literal data packet creation but prior to cryptographic operations, ensuring that does not leak through varying ratios. GnuPG allows users to select compression algorithms via configuration, balancing file size against computational overhead. Regarding compliance, GnuPG fully implements the OpenPGP message format as specified in RFC 4880, ensuring with legacy systems. The OpenPGP standard was revised in RFC 9580 to obsolete RFC 4880, incorporating enhancements such as new packet formats and algorithm identifiers to support post-quantum like lattice-based encryption. However, as of November 2025, GnuPG does not implement RFC 9580 due to disagreements on certain design choices; instead, it adheres to RFC 4880 and advances post-quantum readiness through the LibrePGP specification, which proposes alternative extensions for quantum-resistant algorithms while maintaining core format compatibility.

Development History

Origins and Early Development

The development of GNU Privacy Guard (GnuPG) emerged in the late as a response to limitations in the original (PGP) software. PGP was created by in 1991 as a free tool for and digital signatures, aimed at protecting privacy amid concerns over government surveillance. However, U.S. export controls on cryptographic software under the led to a federal investigation of Zimmermann starting in 1993, treating PGP as a munition and restricting its international distribution. The case was dropped in 1996, but PGP was subsequently commercialized through PGP Inc., which was acquired by Network Associates in 1997, resulting in proprietary versions that limited free access and modification. In 1997, German developer Werner Koch initiated the GnuPG project to produce a free and open-source implementation of the emerging OpenPGP standard (RFC 1991 at the time), ensuring compatibility with PGP while adhering to the free software principles. Koch, motivated by the need for an unencumbered alternative after attending a talk by founder , focused initially on platforms to provide command-line tools for , signing, and . The first release, version 0.0.0, occurred on December 20, 1997, as a basic prototype that avoided patented algorithms like and IDEA by substituting ElGamal for public-key and Blowfish for symmetric , thereby sidestepping legal restrictions on international distribution and use. Early development faced significant challenges in implementing the complex OpenPGP specification without infringing on s held in various countries, particularly for core algorithms in PGP 2.x compatibility, which relied on IDEA—a valid until 2012 in many regions. Koch's solo efforts were bolstered by community contributions, such as Michael Roth's Triple-DES implementation in 1998 and Matthew Skala's clean code, enabling broader algorithm support while maintaining avoidance. These contributions helped refine interoperability with PGP 2.x messages and keys, though GnuPG required specific options like --rfc1991 for full . By mid-1998, pre-release versions began aligning more closely with OpenPGP drafts, addressing bugs in key handling and message formats. A key milestone came with the release of version 1.0.0 on September 7, 1999, marking the first stable, production-ready edition and achieving full compliance with the finalized OpenPGP standard (RFC 2440). This version incorporated support following patent expirations and negotiations, solidifying GnuPG as a viable PGP replacement for Unix users and laying the foundation for its widespread adoption in ecosystems.

Major Versions and Branches

The GNU Privacy Guard (GnuPG) has evolved through distinct version branches, with the 1.x series serving as the foundational stable release line from 1999 to its deprecation, emphasizing core OpenPGP functionality in a single-process architecture. The 1.x branch, beginning with version 1.0.0 on September 7, 1999, focused on basic encryption, signing, and key management without advanced agent-based features, supporting legacy PGP-2 keys and maintaining simplicity for broad compatibility. Development continued through sub-branches like 1.2 (2002) and 1.4 (2004), with the latter providing long-term stability and security updates until its final release, 1.4.23, on June 11, 2018, after which it entered end-of-life status and was deprecated in favor of the 2.x series for all new deployments. The 2.x branch, initiated as a comprehensive rewrite, introduced a multi-process to enhance and security, starting with version 2.0.0 released on November 13, 2006, which integrated OpenPGP and support while replacing the integrated cryptographic library with . A key advancement came in the 2.1 series, launched with 2.1.0 on November 6, 2014, making gpg-agent mandatory for passphrase caching and private key operations, thereby improving and enabling features like integration; this series also added initial (ECC) support, including Ed25519 for keys and for encryption. The 2.1 branch reached end-of-life with 2.1.22 in July 2017, transitioning users to the stable 2.2 series starting August 28, 2017 (2.2.0), which prioritized reliability with ongoing maintenance releases up to 2.2.42 on November 28, 2023, incorporating bug fixes and minor enhancements without major architectural shifts. Subsequent stable branches built on this foundation: the 2.3 series (starting April 8, 2021 with 2.3.0) introduced default key generation for new pairs, enhancing performance and security for modern use cases. The 2.4 series, released December 20, 2022 (2.4.0), focused on stability with performance optimizations, new utilities for key handling, and further refinements, including better support for curve-based operations; it remains the recommended stable branch, with updates like 2.4.7 in November 2024 addressing bugs and CVEs. The modern 2.5 series, entering public testing in 2024 with 2.5.0 on July 8, 2024, and 2.5.1 on September 12, 2024, adds experimental support via algorithms like those from NIST's efforts, alongside gpg-agent enhancements for better integration with quantum-resistant keys; the latest release, 2.5.13 on October 22, 2025, includes bug fixes and feature refinements for this branch. GnuPG maintains parallel branches for stable (e.g., 2.4) and development (e.g., 2.5) tracks, allowing users to choose based on needs for proven reliability versus cutting-edge features. Specialized variants like GnuPG Portable, bundled in for Windows since version 2.0 in , provide self-contained installations without system dependencies, supporting the same core branches but optimized for portability. The shift from 1.x to 2.x emphasized of single-process designs, urging for access to multi-process benefits like isolated handling via gpg-agent and dirmngr.

Implementation and Platforms

Supported Operating Systems

GNU Privacy Guard (GnuPG) provides native support for a wide range of operating systems, where it is typically installed via distribution package managers such as apt on Debian-based systems or yum/dnf on Red Hat-based distributions like . It compiles and runs on various architectures including amd64, x86, arm64, armhf, PowerPC, and others on GNU/Linux kernels. BSD variants such as , , and are also fully supported, with periodic testing to ensure compatibility. Additional systems like AIX and receive support as well. On these Unix-like platforms, GnuPG relies on several key libraries for its functionality, including libgcrypt for cryptographic primitives, libassuan for inter-process communication, libgpg-error for error handling, libksba for X.509 and CMS support, and npth for threading. Builds utilize Autoconf for configuration, enabling compilation on any modern POSIX-compliant system without dependencies on Java or .NET frameworks. The source code's portability ensures it can be cross-compiled for embedded systems targeting POSIX environments, such as resource-constrained Linux-based devices. For Windows, GnuPG is distributed through the bundle, which provides a complete package including the core GnuPG tools, with the first production release occurring in April 2006. It supports 64-bit versions of and 11 natively, as well as 32-bit and 64-bit systems from onward, with portable executables available for environments without installation privileges. facilitates seamless use on Windows by bundling necessary dependencies and tools. On macOS, GnuPG can be installed via package managers like Homebrew with the command brew install gnupg or , supporting both and architectures. For a , the GPG Suite from GPGTools provides an integrated bundle that includes GnuPG along with applications for and , compatible with macOS versions including Sonoma and later. Beyond desktop environments, GnuPG sees use on mobile platforms through compatible implementations. On , the OpenKeychain app provides OpenPGP functionality interoperable with GnuPG, allowing , , and signing via the standard protocols. iOS support is limited by platform restrictions preventing a native GnuPG binary, but end-user apps like iPGMail provide OpenPGP functionality including and , while developers can use libraries such as ObjectivePGP for integration.

Integration and Tools

GnuPG's core functionality is provided through a set of command-line tools that handle , signing, , and related operations. The primary tool, gpg, serves as the main for encrypting and decrypting data, signing and verifying messages, and managing OpenPGP keys. Complementing this, gpg-agent operates as a daemon to manage private keys and passphrases, caching credentials to avoid repeated entry and providing backend services to other GnuPG components. For hardware integration, scdaemon facilitates communication with smartcards and cryptographic tokens, enabling secure key storage and operations on physical devices. Additionally, dirmngr manages access to keyservers and certificate directories, supporting key retrieval, validation, and directory services for distributed trust models. Graphical frontends enhance usability for users preferring visual interfaces over the command line. Kleopatra acts as a unified certificate manager and frontend for GnuPG, offering tools for , , and on Windows and platforms. Seahorse, integrated with the GNOME desktop environment, provides a user-friendly interface for managing PGP and SSH keys, including import, export, and basic signing operations. For programmatic integration, GnuPG offers libraries that abstract its capabilities into suitable for application development. The GPGME (GnuPG Made Easy) library provides a high-level C for tasks like , decryption, signing, and , allowing developers to with GnuPG's OpenPGP backend without direct command-line invocation. Language bindings extend this accessibility; for instance, official bindings enable automation of GnuPG operations in scripts, such as batch key handling or message processing. GnuPG integrates seamlessly with various applications to embed privacy features into workflows. In email clients, it supports OpenPGP encryption and signing; for example, the deprecated Enigmail add-on previously enabled GnuPG usage in , but has included native OpenPGP support since version 78 (2020), enabling encryption and signing without additional add-ons using the RNP library compatible with GnuPG, while natively incorporates GnuPG for secure messaging in environments. File managers like benefit from Seahorse's extension, which adds right-click options for encrypting and decrypting OpenPGP files directly in the file browser. In , leverages GnuPG via its built-in support for commit signing, where the gpg tool verifies authorship by attaching digital signatures to commits using the commit.gpgsign configuration. Automation capabilities allow GnuPG to operate in non-interactive scripts and pipelines. The gpg tool supports batch mode with the --batch option for scripted encryption and signing without user prompts, facilitating tasks like automated file protection in build processes. Git hooks can invoke GnuPG for pre-commit signing, ensuring verifiable changes in collaborative repositories. scripts using GPGME bindings further enable complex automations, such as bulk message verification or . Recent ecosystem developments include the RNP library as an alternative OpenPGP implementation, providing a high-performance C++ backend for applications seeking independence from GnuPG while maintaining compatibility with its standards.

Security Considerations

Known Vulnerabilities

One of the earliest significant vulnerabilities in GNU Privacy Guard (GnuPG) was identified in 2006, designated as CVE-2006-6235, which involved a overwrite in the OpenPGP packet parser allowing remote execution when processing specially crafted packets. This issue particularly impacted keyserver operations, where untrusted data could be fed into GnuPG, enabling denial-of-service () attacks or worse through on affected systems. Affected versions included GnuPG 1.x prior to 1.4.6 and 2.x prior to 2.0.2, with patches released to mitigate the remotely exploitable overwrite. In 2018, the EFAIL vulnerability exposed weaknesses in OpenPGP implementations like GnuPG when integrated with email clients, exploiting header manipulations to exfiltrate from encrypted messages. Attackers could craft emails that tricked clients into decrypting content via or CSS channels, bypassing end-to-end encryption protections in tools such as with Enigmail or with GPGTools. While not a flaw in GnuPG's core cryptography, it highlighted risks in handling and prompted client-side mitigations like disabling rendering in encrypted emails, with recommendations to use the latest GnuPG version. A more recent issue, CVE-2025-30258 discovered in March 2025, affected key import functionality in GnuPG versions before 2.5.5, where crafted subkey data lacking valid backsignatures or with incorrect usage flags could enable signature forgery during certificate processing. This vulnerability allowed attackers to import malicious keys that appeared legitimate, potentially undermining trust in signatures without compromising private keys directly. The flaw was addressed in GnuPG 2.5.5 through improved validation of subkey attributes. Additional concerns include side-channel attacks on older GnuPG versions, such as timing-based leaks during decryption, where variations in execution time revealed bits of private keys. For instance, cache-timing attacks like those analyzed in GnuPG 1.4.13 could recover up to 96.7% of key bits on average by monitoring cache access patterns. Similarly, the 2024 Marvin attack targeted libgcrypt's implementations (used in GnuPG), exploiting single-trace timing variations to fully recover keys in raw , v1.5, and OAEP modes. GnuPG's gpg-agent has also faced exposure risks through improperly secured Unix domain sockets, potentially allowing local attackers to intercept prompts or manipulate sessions if permissions are misconfigured. Overall, these vulnerabilities have primarily impacted key verification and import processes rather than causing widespread private key compromises, with no evidence of large-scale exploits leading to systemic breaches in GnuPG deployments. Patches are issued through regular stable releases on gnupg.org, with advisories detailing affected versions—such as 2.1 through 2.4 for various key-handling CVEs—and urging users to update promptly. For example, advisories for CVE-2025-30258 recommended immediate upgrades to 2.5.5 or later to prevent forgery risks.

Security Best Practices

To ensure the security of GnuPG operations, users should adopt strong passphrases for protecting private keys, consisting of at least 8 characters including non-alphabetic elements such as numbers and symbols, or alternatively 4-6 random words from a dictionary to enhance memorability without compromising strength. Prefer (ECC) keys, such as Ed25519 for signing and for encryption, over legacy keys due to their efficiency and equivalent security at smaller key sizes, which modern GnuPG versions support by default during . Always set expiration dates on subkeys—typically 1-2 years—to limit damage from potential compromises, while keeping the indefinite. If a key is suspected to be compromised, promptly generate and publish a certificate using gpg --gen-revoke <key-id> to invalidate it across the . For secure configuration, edit the gpg.conf file in the ~/.gnupg/ directory to enforce robust defaults, such as specifying personal-digest-preferences SHA512 SHA256 to disable weak hash algorithms like and prioritize stronger alternatives. Additionally, enable use-agent to integrate with gpg-agent for handling, and configure pinentry tools (e.g., pinentry-gtk or pinentry-qt) to securely for input without echoing to the console, reducing risks from shoulder surfing or logging. Other recommended settings include default-preference-list SHA512 SHA256 AES256 ZLIB [BZIP2](/page/Bzip2) ZIP Uncompressed for , digest, and preferences, ensuring only high-security options are used. In daily usage, always verify signatures with gpg --verify before granting trust to a or , checking the output for indicators like VALIDSIG and ensuring the key's matches expected values obtained through trusted channels. Avoid uploading sensitive keys to public keyservers, opting instead for direct, exchanges like encrypted or in-person to prevent exposure to compromises. When encrypting , include multiple recipients using --encrypt --recipient <user1> --recipient <user2> to facilitate secure sharing without re-encryption, while employing --encrypt-to <default-key> in gpg.conf for automatic self-encryption. Advanced users can implement subkey rotation by periodically adding new subkeys with gpg --quick-add-key <main-key-id> <algo> <expire> and revoking outdated ones via gpg --edit-key <subkey-id> revkey, which helps mitigate long-term key exposure risks. Integrate hardware security tokens like , which supports the protocol, for storing private keys off-system using scdaemon and commands such as gpg --card-edit to initialize and manage them, providing protection against software-based attacks. For auditing, enable verbose output with --verbose during operations to log detailed activities, which can be reviewed for anomalies, and direct output to secure files for analysis. Maintaining requires using the latest GnuPG , such as 2.5.13 released in October 2025, to benefit from patched vulnerabilities and improved algorithms; check updates via the official download page and verify integrity with provided signatures. Subscribe to the gnupg-announce mailing list for timely notifications on releases and advisories, ensuring prompt application of fixes.

References

  1. [1]
    The GNU Privacy Guard
    GnuPG allows you to encrypt and sign your data and communications; it features a versatile key management system, along with access modules for all kinds of ...DownloadDocumentationAll NewsThe GNU Privacy HandbookGetting Started
  2. [2]
    Download - GnuPG
    2025-05-14, 7829k, download · download · GnuPG ... We announce the end-of-life date for a current stable version at the time a new stable version is released.Release Notes · FTP Mirrors · Integrity Check · GIT Access
  3. [3]
    GnuPG Celebrates 10 Years - LWN.net
    Dec 27, 2007 · A Short History of the GNU Privacy Guard ... GnuPG and made the first release under this name (gnupg-0.2.8) on Feb 24 [6]. Just a few days ...
  4. [4]
    [Announce] GnuPG 2.5.13 released
    Oct 22, 2025 · ... Version 2.5.13. This release adds new features and fixes a couple of ... 2025-10-22 ...GnuPG 2.5.12 releasedGnuPG 2.5.8 releasedMore results from lists.gnupg.org
  5. [5]
    [PDF] Using the GNU Privacy Guard
    Using this historical feature to verify a detached signature is strongly discouraged; you should always specify the data file explicitly. Note: When ...
  6. [6]
    People - GnuPG
    May 9, 2025 · Werner started GnuPG in 1997 and still puts most of his working time into the development and maintenance of GnuPG. He has 29 years experience in commercial ...
  7. [7]
  8. [8]
  9. [9]
    GnuPG Frequently Asked Questions
    How do I get help? 2.3. Who maintains this FAQ? 2.4. Is this the official GnuPG FAQ? 2.5. When was this FAQ last checked for accuracy?Foreword · Welcome · What email clients support... · How do I start using GnuPG?
  10. [10]
    Compliance Options (Using the GNU Privacy Guard)
    4.2.5 Compliance options · --gnupg. Use standard GnuPG behavior. · --openpgp. Reset all packet, cipher and digest options to strict OpenPGP behavior. · --rfc4880.
  11. [11]
    Libgcrypt - GnuPG
    Feb 10, 2025 · Libgcrypt is a general purpose cryptographic library originally based on code from GnuPG. It provides functions for all cryptograhic building ...Missing: modular | Show results with:modular
  12. [12]
    Related Software - GnuPG
    Mar 23, 2017 · GnuPG is a command line tool without any graphical user interface. It is an universal crypto engine which can be used directly from a command line prompt.
  13. [13]
    RFC 4880: OpenPGP Message Format
    Summary of each segment:
  14. [14]
    RFC 9580: OpenPGP
    Summary of each segment:
  15. [15]
  16. [16]
    Public Key Algorithms (The 'GnuPG Made Easy' Reference Manual)
    4.1 Public Key Algorithms. Public key algorithms are used for encryption, decryption, signing and verification of signatures.Missing: cryptographic | Show results with:cryptographic
  17. [17]
    General public-key related Functions (The Libgcrypt ... - GnuPG
    A couple of utility functions are available to retrieve the length of the key, map algorithm identifiers and perform sanity checks.
  18. [18]
  19. [19]
  20. [20]
    Cryptographic Functions (The Libgcrypt Reference Manual) - GnuPG
    Libgcrypt provides three functions for digital signatures. Those functions are useful when hashing computation should be closely combined with signature ...
  21. [21]
  22. [22]
    Available ciphers (The Libgcrypt Reference Manual) - GnuPG
    The Twofish algorithm with a 128 bit key. An algorithm which is 100% compatible with RSA Inc.'s RC4 algorithm. Note that this is a stream cipher and must be ...
  23. [23]
  24. [24]
  25. [25]
  26. [26]
    The GNU Privacy Handbook - GnuPG
    This chapter is a quick-start guide that covers the core functionality of GnuPG. This includes keypair creation, exchanging and verifying keys, encrypting and ...<|control11|><|separator|>
  27. [27]
  28. [28]
    Key Derivation (The Libgcrypt Reference Manual) - GnuPG
    Libgcypt provides a general purpose function to derive keys from strings. Derive a key from a passphrase. keysize gives the requested size of the key in octets.
  29. [29]
  30. [30]
    OpenPGP Key Management (Using the GNU Privacy Guard)
    This section explains the main commands for key management. This is a simple command to generate a standard key with one user id.
  31. [31]
    GPG Configuration (Using the GNU Privacy Guard)
    If this file is not available, gpg defaults to the new keybox format and creates a file pubring.kbx unless that file already exists in which case that file will ...
  32. [32]
    What's new in GnuPG 2.1
    Nov 4, 2014 · GnuPG version 2.1 (now known as 2.2) comes with a bag of new features which changes some things old-timers are used to.Missing: history | Show results with:history
  33. [33]
    GPG Configuration Options (Using the GNU Privacy Guard)
    The keyserver hkp://keys.gnupg.net uses round robin DNS to give a different keyserver each time you use it. This is a space or comma delimited string that ...Missing: page | Show results with:page
  34. [34]
    Agent Options (Using the GNU Privacy Guard)
    On Windows systems it is possible to install GnuPG as a portable application. In this case only this command line option is considered, all other ways to set a ...Missing: introduction | Show results with:introduction
  35. [35]
  36. [36]
  37. [37]
  38. [38]
  39. [39]
  40. [40]
  41. [41]
  42. [42]
  43. [43]
  44. [44]
  45. [45]
  46. [46]
    RFC 9580: OpenPGP
    This document specifies the message formats used in OpenPGP. OpenPGP provides encryption with public key or symmetric cryptographic algorithms, ...Table of Contents · Introduction · Data Element Formats · Packet Types
  47. [47]
    LibrePGP
    LibrePGP is an alternative, updated specification of the OpenPGP encryption standard. It was developed as a response to changes made to the OpenPGP ...
  48. [48]
    Phil Zimmermann's Home Page
    Originally designed as a human rights tool, PGP was published for free on the Internet in 1991. This made Zimmermann the target of a three-year criminal ...Missing: controls | Show results with:controls
  49. [49]
    Data-Secrecy Export Case Dropped by U.S. - The New York Times
    Jan 12, 1996 · Zimmermann developed the software as part of his personal campaign to make it simple and inexpensive to send scrambled messages. Using such ...
  50. [50]
    The World's Email Encryption Software Relies on One Guy, Who is ...
    Feb 5, 2015 · Werner Koch wrote the software, known as Gnu Privacy Guard, in 1997, and since then has been almost single-handedly keeping it alive with ...
  51. [51]
    First release - GnuPG and GNUTLS Mailing List Archives
    Dec 20, 1997 · First release. Werner Koch wk at isil.d.shuttle.de. Sat Dec 20 19:12:12 CET 1997. Previous message: reality check; Next message: First ...
  52. [52]
    GnuPG's 10th birthday - GNU mailing lists
    A Short History of the GNU Privacy Guard ======================================== It's been a decade now that the very first version of the ...
  53. [53]
    Replacing PGP 2.x with GnuPG
    x predates the OpenPGP specification, the armored message header PGP 2.x uses is not compliant with OpenPGP. Because private key export is rare, GnuPG does ...
  54. [54]
    GnuPG 1.0 released
    Sep 7, 1999 · GnuPG 1.0 released. Werner Koch wk at gnupg.org. Tue Sep 7 20:01:00 CEST 1999. Previous message: A pre 1.0 release ...
  55. [55]
    Release Notes - GnuPG
    Release Notes for GnuPG. Please read the NEWS file for a complete and up-to-date list. Note that this page is deprecated and is not updated anymore.
  56. [56]
  57. [57]
  58. [58]
    [Announce] GnuPG 2.4.7 and Gpg4win 4.4.0 released
    Nov 28, 2024 · We are pleased to announce the availability of a new stable GnuPG release: version 2.4.7. This version fixes a couple of bugs.
  59. [59]
    Gpg4win/releases - GnuPG wiki
    Jul 15, 2022 · Version 2.0 · 2010-07-28: Gpg4win 2.0.4 released (de|en - Announcement) · 2010-05-29: Gpg4win 2.0.3 released (de|en - Announcement) · 2010-04-12: ...
  60. [60]
    Supported Systems - GnuPG
    Sep 1, 2025 · GnuPG works on GNU/Linux (amd64, x86, etc), 64-bit Windows 10/11, MacOS X, OpenBSD, FreeBSD, NetBSD, AIX, and Solaris.
  61. [61]
    GnuPG-2.4.8 - Linux From Scratch!
    The GnuPG package is GNU's tool for secure communication and data storage. It can be used to encrypt data and to create digital signatures.Missing: Autoconf POSIX
  62. [62]
    Using the GNU Privacy Guard: System Notes
    GnuPG has been developed on GNU/Linux systems and is know to work on almost all Free OSes. All modern POSIX systems should be supported right now, however ...
  63. [63]
    Gpg4win - Secure email and file encryption with GnuPG for Windows
    Nov 27, 2024 · Gpg4win (GNU Privacy Guard for Windows) is Free Software and can be installed with just a few mouse clicks.
  64. [64]
    [Announce] Gpg4win 1.0.0 released
    Apr 7, 2006 · [Announce] Gpg4win 1.0.0 released. Werner Koch wk at gnupg.org. Fri Apr 7 13:56:17 CEST 2006. Previous message: [Announce] GnuPG 1.4.3 ...
  65. [65]
    gnupg - Homebrew Formulae
    Install command: brew install gnupg. Also known as: gnupg@2.4, gpg, gpg2. Formerly known as: gnupg2. GNU Pretty Good Privacy (PGP) package.<|separator|>
  66. [66]
    GPG Suite
    Use GPG Suite to encrypt, decrypt, sign and verify files or messages. Manage your GPG Keychain with a few simple clicks and experience the full power of GPG ...
  67. [67]
    OpenKeychain · OpenKeychain
    OpenKeychain helps you communicate more privately and securely. It uses encryption to ensure that your messages can be read only by the people you send them to.Blog · Help · FAQ · Contribute
  68. [68]
    How to use GPG with IOS (Create keypair, List Keys, Import public ...
    Dec 23, 2016 · I am looking for the very basic operations as described in this title (Create keypair, List Keys, Import public key, encrypt, decrypt)GNUPG decryption in iOS environment - Stack OverflowError while compiling GnuPG for iOS Simulator + iOS - Stack OverflowMore results from stackoverflow.com
  69. [69]
    Top (Using the GNU Privacy Guard)
    ### Summary of Core Tools in GnuPG Manual (Version 2.5.6, April 2025)
  70. [70]
    Frontends - GnuPG
    Feb 15, 2024 · Here it is some lists of software with support for GnuPG. For your convenience, frontends have been grouped together into homogeneous categories.Missing: operating | Show results with:operating
  71. [71]
    GpgME - GnuPG
    May 3, 2018 · It provides a High-Level Crypto API for encryption, decryption, signing, signature verification and key management. Currently it uses ...Missing: integration | Show results with:integration
  72. [72]
    HOWTOs - GnuPG
    Mar 17, 2023 · Written "in house" by the GnuPG Project core team, the GPGME Python Bindings HOWTO provides detailed instructions and examples for using the ...
  73. [73]
    Email Clients - GnuPG wiki
    Mar 18, 2025 · GnuPG is a crypto framework that can be used by other applications. This page lists some Free Software email clients you may use.Missing: Nautilus | Show results with:Nautilus<|separator|>
  74. [74]
    RNP | Powering end-to-end email encryption in Mozilla Thunderbird ...
    RNP proudly supports LibrePGP. RNP is excited to announce our support for LibrePGP, a new specification of the OpenPGP encryption standard that builds on the ...
  75. [75]
    CVE-2006-6235 Detail - NVD
    A "stack overwrite" vulnerability in GnuPG (gpg) 1.x before 1.4.6, 2.x before 2.0.2, and 1.9.0 through 1.9.95 allows attackers to execute arbitrary code.
  76. [76]
    remotely controllable function pointer [CVE-2006-6235]
    Dec 6, 2006 · This is a remotely exploitable bug and affects any use of GnuPG where an attacker can control the data processed by GnuPG.
  77. [77]
    EFAIL
    May 14, 2018 · EFAIL describes vulnerabilities in the end-to-end encryption technologies OpenPGP and S/MIME that leak the plaintext of encrypted emails.
  78. [78]
    Efail press release - GnuPG and GNUTLS Mailing List Archives
    You might be vulnerable if you're running an ancient version of GnuPG (the 1.0 series; the current is 2.2), or if your email plugin doesn't ...
  79. [79]
    CVE-2025-30258 Detail - NVD
    Mar 19, 2025 · In GnuPG before 2.5.5, if a user chooses to import a certificate with certain crafted subkey data that lacks a valid backsig or that has incorrect usage flags.
  80. [80]
    A side-channel attack on GnuPG - LWN.net
    Feb 17, 2016 · It is a passive attack that exploits a side channel in the GNU ... And they each take a different amount of time, giving rise to timing attacks.
  81. [81]
    Side-channel vulnerability in libgcrypt - the Marvin Attack
    Mar 15, 2024 · ... RSA will be vulnerable: raw RSA >>> (RSASVE), PKCS#1v1.5, and RSA-OAEP. >> >> The major possible causes of timing ... gnupg.org/documentation ...
  82. [82]
    All News - GnuPG
    On this page you'll find all the news of previous years in reverse chronological order. News for the current year are found at the main page.Missing: history | Show results with:history
  83. [83]
    Top (Using the GNU Privacy Guard)
    ### Summary of GnuPG Documentation on Specified Topics
  84. [84]