Crates.io | tupm |
lib.rs | tupm |
version | 0.1.0 |
source | src |
created_at | 2017-07-21 17:55:56.707082 |
updated_at | 2017-08-02 14:52:22.704919 |
description | Terminal Universal Password Manager |
homepage | https://cafbit.com/post/tupm/ |
repository | https://github.com/simmons/tupm |
max_upload_size | |
id | 24410 |
size | 207,500 |
The Terminal Universal Password Manager (tupm
) is a terminal-based
interface to password manager databases produced by the
Universal Password Manager (UPM) project.
This is a proof-of-concept exercise, and should not be used in
production to protect real secrets.
Important disclaimers:
Tupm is dual-licensed under MIT or Apache 2.0, the same as Rust itself.
Tupm may be downloaded and installed via the Rust cargo
command:
$ cargo install tupm
Terminal Universal Password Manager 0.1.0
Provides a terminal interface to Universal Password Manager (UPM) databases.
USAGE:
tupm [FLAGS] [OPTIONS]
FLAGS:
-e, --export Export database to a flat text file.
-h, --help Prints help information
-p, --password Prompt for a password.
-V, --version Prints version information
OPTIONS:
-d, --database <FILE> Specify the path to the database.
-l, --download <URL> Download a remote database.
Running tupm
with no arguments will load the database present in
$HOME/.tupm/primary
or create a new database if one does not already
exist. A different database path may be specified with the --database
option.
Alternately, a database can be imported from an existing UPM sync
repository with the --download
option. (Only HTTP/HTTPS based
repositories are supported. The option to use Dropbox is not
supported.) The repository URL (without the database name appended)
should be provided. By default, a database named "primary" is
downloaded and installed into $HOME/.tupm/primary
, unless an alternate
database path was specified with --database
. You will be prompted for
the HTTP username and password credentials:
$ tupm --download https://example.edu/repo/
Downloading remote database "primary" from repository "https://example.edu/repo/".
Repository username: username
Repository password:
23708 bytes downloaded from repository.
Database written to: /home/username/.tupm/primary.
After a database is loaded, you are presented with a user interface
showing a navigable list of accounts, detailed information about the
selected account, a filter box (quickly accessible by pressing /
), and
a menu of options accessible by pressing escape or \
. Most menu
options have keyboard shortcuts for direct invocation.
For the exceptionally brave among you, the --export
command-line
argument will write a full plaintext report of the contents of the
database to standard output. (It goes without saying that such exported
data is not at all protected by encryption and thus highly vulnerable.)
I wrote Tupm as a Rust learning exercise. I'm making it available on the off chance that other developers might find its code useful when interoperating with UPM databases. However, for several reasons, I'd like to discourage anyone from using it directly to manage passwords.
Work on UPM goes back to 2005, and its usage of cryptography would probably be considered less than ideal by 2017 standards. I'm not a cryptographer, but I do have several concerns about the cryptography used in the UPM format.
While Tupm is running, sensitive materials such as the master password, derived keys, and the stored account passwords are stored in memory in the clear, with little or no provision for erasing them when they are no longer needed. This is okay for a proof-of-concept demonstration, but would definitely be not good for a production password manager.
Developing a set of best practices for handling such material in a cross-platform application would be a great research project in and of itself, and probably consider steps such as:
mlock()
/munlock()
to prevent sensitive data from being swapped to disk, and
mprotect()
to prevent such data from being saved with core dumps.In addition to the memory of the Tupm program itself, sensitive information could leak through adjacent programs. For example, passwords shown in the terminal may remain in the scrollback buffer, and passwords copied to the system clipboard remain there until overwritten.
Thanks to Adrian Smith for developing the original UPM programs, Alexandre Bury for the Cursive library used to provide the terminal-based user interface, and the greater Rust community.