Specifying passphrase for batch key generation

Joey Castillo jose.castillo at gmail.com
Wed Jan 14 21:59:51 CET 2015

Reading the manual for batch GPG key generation in GnuPG 2.1, I see
the following note:

> Since GnuPG version 2.1 it is not anymore possible to specify a passphrase for unattended key generation. The passphrase command is simply ignored and ‘%ask-passpharse’ is thus implicitly enabled.

I'm running into an issue now with a module I was using to generate
keys in a python script (python-gnupg). Its method was to generate a
set of parameters, including the passphrase parameter, and pass that
via stdin to gpg --batch --gen-key.

Now that we cannot specify a passphrase in the batch parameters, what
is the preferred method for batch key generation with a specified

More information about the Gnupg-users mailing list