1

I am using Arch Linux and GnuPG

Linux ryantm0j132 3.12.9-2-ARCH #1 SMP PREEMPT Fri Jan 31 10:22:54 CET 2014 x86_64 GNU/Linux

and GnuPG

gpg (GnuPG) 2.0.22
libgcrypt 1.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: ~/.gnupg
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECC, ?
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2

Using gpg --gen-key, it pops up a GUI dialog box that asks to enter a passphrase. How do I paste a long string of characters into the passphrase text box? I could type the long string of characters in, but I would have to do that repeatedly in the future.

1

One workaround might be to switch to pinentry-curses instead of the GUI pinentry, which offers "normal" command line pinentry (where you should be able to paste the password to). It seems it gets installed by default on Arch Linux (dependency of package gnupg).

To do so, modify the option pinentry-program in ~/.gnupg/gpg-agent.conf to pinentry-curses. It is also explained in the Arch Linux wiki and for Ubuntu linux, I also explained how to do this (in another context) on Ask Ubuntu.

Alternatively, you might use another non-interactive option for providing the password. From man gpg (these are all parameters to gpg and you should also be able to put them into gpg.conf):

   --passphrase-fd n
          Read  the passphrase from file descriptor n. Only the first line
          will be read from file descriptor n. If you use  0  for  n,  the
          passphrase  will  be  read  from STDIN. This can only be used if
          only one passphrase is supplied.

   --passphrase-file file
          Read the passphrase from file file. Only the first line will  be
          read  from  file  file.  This  can  only  be  used  if  only one
          passphrase is supplied. Obviously, a passphrase stored in a file
          is  of  questionable security if other users can read this file.
          Don't use this option if you can avoid it.

   --passphrase string
          Use string as the passphrase. This can only be used if only  one
          passphrase  is supplied. Obviously, this is of very questionable
          security on a multi-user system. Don't use this  option  if  you
          can avoid it.
1
  • Changing the pinentry-program works for me. – RyanTM Mar 2 '14 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.