Purse/README.md

82 lines
2.6 KiB
Markdown
Raw Normal View History

2018-06-02 20:31:01 +00:00
# Purse
2015-07-02 02:11:49 +00:00
Purse is a fork of [drduh/pwd.sh](https://github.com/drduh/pwd.sh).
2018-06-02 20:31:01 +00:00
2024-03-10 21:59:33 +00:00
Both programs are Bash shell scripts which use [GnuPG](https://www.gnupg.org/) to manage passwords and other secrets in encrypted text files. Purse is based on asymmetric (public-key) authentication, while pwd.sh is based on symmetric (password-based) authentication.
2018-06-02 20:31:01 +00:00
2024-03-10 21:59:33 +00:00
While both scripts use a trusted crypto implementation (GnuPG) and safely handle passwords (never saving plaintext to disk), Purse eliminates the need to remember and use a master password - just plug in a YubiKey, enter the PIN, then touch it to decrypt a password to clipboard.
2018-06-02 20:31:01 +00:00
By using Purse with YubiKey, the risk of master password theft or keylogging is eliminated - only physical possession of the Yubikey AND knowledge of the PIN can unlock the encrypted index and password files.
2015-07-02 02:11:49 +00:00
# Release notes
2015-07-02 02:11:49 +00:00
2024-03-10 21:59:33 +00:00
See [Releases](https://github.com/drduh/Purse/releases)
2024-03-10 21:59:33 +00:00
# Use
2024-03-10 21:59:33 +00:00
This script requires a GnuPG identity - see [drduh/YubiKey-Guide](https://github.com/drduh/YubiKey-Guide) to set one up. Multiple identities stored on several YubiKeys are recommended for improved durability and reliability.
2024-03-10 21:59:33 +00:00
Clone the repository:
2024-03-10 21:59:33 +00:00
```console
git clone https://github.com/drduh/Purse
```
2024-03-10 21:59:33 +00:00
Or download the script directly:
2018-06-02 20:31:01 +00:00
```console
2024-03-10 21:59:33 +00:00
wget https://github.com/drduh/Purse/blob/master/purse.sh
2018-06-02 20:31:01 +00:00
```
2024-03-10 21:59:33 +00:00
(Version 2b and older) Set the GnuPG key ID with `export PURSE_KEYID=0xFF3E7D88647EBCDB` or by editing `purse.sh`
2015-07-03 04:52:34 +00:00
2024-03-10 21:59:33 +00:00
Run the script interactively using `./purse.sh` or symlink to a directory in `PATH`:
2015-07-02 02:11:49 +00:00
* Type `w` to write a password
* Type `r` to read a password
* Type `l` to list passwords
* Type `b` to create an archive for backup
* Type `h` to print the help text
Options can also be passed on the command line.
2015-07-02 02:31:38 +00:00
Example usage:
2024-03-10 21:59:33 +00:00
Create a 20-character password for `userName`:
```console
2024-03-10 21:59:33 +00:00
./purse.sh w userName 20
```
Read password for `userName`:
```console
2024-03-10 21:59:33 +00:00
./purse.sh r userName
```
2024-03-10 21:59:33 +00:00
Passwords are stored with a timestamp for revision control. The most recent version is copied to clipboard on read. To list all passwords or read a specific version of a password:
```console
2024-03-10 21:59:33 +00:00
./purse.sh l
2024-03-10 21:59:33 +00:00
./purse.sh r userName@1574723600
```
Create an archive for backup:
2015-07-02 02:03:55 +00:00
```console
2024-03-10 21:59:33 +00:00
./purse.sh b
```
2015-10-31 02:25:03 +00:00
Restore an archive from backup:
2015-10-31 02:25:03 +00:00
```console
2024-03-10 21:59:33 +00:00
tar xvf purse*tar
```
2015-10-31 02:25:03 +00:00
2024-03-10 21:59:33 +00:00
**Note** For additional privacy, the recipient key ID is **not** included in metadata (`throw-keyids` option).
2024-03-10 21:59:33 +00:00
The password index file can also be encrypted by changing the `encrypt_index` variable to `true` in the script.
2024-03-10 21:59:33 +00:00
See [config/gpg.conf](https://github.com/drduh/config/blob/master/gpg.conf) for additional configuration options.