[pass] Adding support for symmetric encryption

Dahlberg, David david.dahlberg at fkie.fraunhofer.de
Wed Jan 27 09:11:16 CET 2016

Am Dienstag, den 26.01.2016, 20:21 +0100 schrieb Dashamir Hoxha:
> Now it picks out automatically which gpg encryption to use,
> based on the presence of the file .gpg-id

"pass init gpg-id" -> "pass init [gpg-id]" sounds dangerous to me. Like
somebody who only half-remembers the commands (as most of us do) and
does not pay too much attention may end up with a working password-store 
that is only encrypted with his smartcard PIN if he enters the

    pass init

> On the init command, if no gpg-id is given as argument,
> then no .gpg-id file will be created, and the rest will always be
> symmetric encryption/decryption.

The same applies here. In the current password-store semantics, a
directory with a missing ".gpg-id" inherits the encryption key from it's
parent. A missing .gpg-id in the root directory is taken as an indicator
of a non-initialized store.

So if you make a missing ".gpg-id" an indication of symmetric
encryption, either you cannot cannot use symmetric for a sub-tree of an
asymmetric tree, or you have to make sure that the ".gpg-id" is written
into every sub-directory (which requires switching/converting to a new
binary format) or you cannot have multiple keys per sub-tree any more.

My advice would be to make symmetric encryption explicit:
 * "pass init -s" and
 * "cat symmetric" > "$PASSWORD_STORE_DIR/.gpg-id"


More information about the Password-Store mailing list