GnuPG Version Compatibility
As of June 2023, there are three active branches of GnuPG: 2.4, 2.2, and 1.4. GnuPG versions 2.4.1 and later suffer from GnuPG bug T6481 and are hardly usable with Emacs. There is a patch for that bug available at least for GnuPG version 2.4.1, which your operating system or distribution might provide already. GnuPG 1.4 is considered a legacy version.
Besides that, all of those branches mentioned above should work flawlessly with Emacs with basic use-cases. They have, however, some incompatible characteristics, which might be visible when used from Emacs.
- The key store format used by GnuPG 2.1 is incompatible with 1.4. That means, a key created with GnuPG 2.1 is not visible with 1.4.
- GnuPG 2.1 uses a fixed address for the Unix domain socket used to communicate with
gpg-agent. TheGPG_AGENT_INFOenvironment variable, which is used by GnuPG 2.0 and 1.4, is ignored. That means, if your system has both GnuPG 2.1 and 1.4, the gpg command from GnuPG 1.4 is not able to usegpg-agentprovided by 2.1 (at least out of box). - GnuPG 2.1 (2.1.5 or later) has a mechanism to direct the Pinentry password prompt to the Emacs minibuffer. See GnuPG Pinentry.