Tag Archiv für GPG

Enigmail’s Pinentry: copy and paste problem

Using Enigmail to encrypt your emails with GnuPG (GPG) in combination with a password manager will give you a hard time.
Enigmail’s tool Pinentry, which is used to enter your passphrase for encryption, refuses to insert phrases from the clipboard.
So the usual way, copying the password from your manager to the input field, won’t work.

There is a solution for KeePass Password Safe version 1.x (and 2.x): Auto-Type.
Edit your GPG passphrase entry in KeePass and add the following two lines to the Notes field:
Auto-Type: {PASSWORD}
Auto-Type-Window: pinentry

When the Pinentry Window appears next time, trigger the KeePass Auto-Type function with: Ctrl + Alt + A.
Your KeePass Databes must be open and decrypted at this moment.
The shortcut can be changed in KeePass 1.x: Tools > Options > Advanced > Auto-Type.
If the shortcut doesn’t work or you don’t want to use it you can also right click your key in keepassx and hit „run autotype“.

I’m sure there is a similar (when not the same) way in KeePass 2.x, I just couldn’t test it yet.

Why is copy and paste blocked? The blocking protects you from attacks by (java) scripts reading and submitting the clipboard content.

For Linux users:
If the passwords, written by keepassx autotype function, keep getting rejected, keepass is probably using the wrong keyboard layout. You can test what autotype is writing by using a normal texteditor as target instead of the passwordfield which hides the input under the *stars*. I didn’t find a satisfying solution yet, but a workaround: set the layout to what you need it to be by typing:
setxkbmap XY
XY is the country code – for example de for germany.