# password store

A while ago I read a post by Jay Scot[1] that described the numerous
dependencies of the pass(1) password-store on an OpenBSD system and
his replacement of it with a shell script and a command to generate
new password files.

His script is tailored to work with dmenu. I have largely plagiarized
his work and modified it for my own purposes. In doing so I have
integrated the new password generation command into the shell
script[2].


## Usage

You must first export an environment variable for your password
store.  If you have been using pass already on OpenBSD, then the
following should work:
> $ export PASSWORD_STORE="$HOME/.password-store"

Don't forget to add the above export to your .kshrc, or whatever,
so that it is set next time you come to use it.

If all is well the following will list all your password files.
> $ pw

The following will list files based on a partial match, if there
are more than one, or it will request you to enter your password
to decrypt the file.
> $ pw <part-match>

If only one was found, after entering the password, it will be
copied to your pastebuffer for pasting.


## Flags

There are two additional flags that can be used:
-n Which when supplied with a filename will generate a random
password, create a new password file and copy the password to your
pastebuffer.
> $ pw -n <new-filename>

-v Which will list files based on a partial match, if there are
more than one, or it will request you to enter your password to
decrypt the file.

If only one was found, after entering the password, the file will
be printed to stdout.
> $ pw -v <part-match>

This is useful if you have several pieces of information within the
file you need access to.

At the top of the pw script is a variable, PB_SECONDS. This determines
the amount of seconds after which the pastebuffer is overwritten,
the default is 30 seconds.


## References

[1]( gopher://ams.jay.scot/0/phlog/016.txt )
[2]( gopher://gopher.icu/0/files/pw )