Why gpg 2.1.9 cannot export secret key without passphrase?

Andrey Utkin andrey.od.utkin at gmail.com
Sun Dec 6 21:41:48 CET 2015

Just for note.
This can be worked around the following way (works in both 1.4 and 2.1,
didn't test in 2.0).
1. Export key, giving any non-empty passphrase.
2. Import key on new location supposed for automated key usage.
3. `gpg --edit-key <key id>`, there type "passwd", enter old passphrase,
enter empty line twice, strike Ctrl+D, confirm changes saving. This
works identically in both 1.4 and 2.1.

If importing location has no capability of passphrase changing
(--edit-key) - e.g. Android Open Keychain - import it to 1.4 keychain,
then export it, it will let you export it without passphrase (won't even
ask for it).

Thank you Peter for pointing out that this is solvable without fixing
the issue in code, but your suggested solution wasn't enough, so I had
to go a few steps further :)

I'd like to state this explicitly (due to rational point made by Peter)
that the link to my private GnuPG git fork with a patch is not supposed
a working solution - it is an experimental work in progress which is not
assured for being interoperable. It is a fruit of uneducated reckless
tinkering with original code.

OpenPGP usage is appreciated (it also helps your letter to bypass spam
filters). To email me with encryption easily, go

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: </pipermail/attachments/20151206/7272ef63/attachment.sig>

More information about the Gnupg-users mailing list