A terminal-based password manager, generator, and importer/exporter (Firefox, Chrome) backed with a concurrent hashmap

Overview

rucksack

A terminal-based password manager, generator, and importer/exporter (Firefox, Chrome) backed with a concurrent hashmap

Features

  • Password generator (0.1.0)
  • Encrypted local storage (0.2.0)
  • Concurrent hashmap for use by daemons (0.2.0)
  • List secrets, both encrypted and decrypted (0.3.0)
  • Supports Firefox and Chrome CSV formats (for importing, 0.3.0 and exporting, 0.5.0)
  • Searching secrets via filtering (0.4.0)
  • Reports on password quality, duplicates, etc. (0.5.0)
  • Add new records to the DB (and support updates) via CLI subcommands (0.6.0)
  • Database restores
  • Local network sync
  • Firefox Account Sync Client

Installation

cargo install rucksack

Usage

Top-level help:

rucksack help

Output:

rucksack: A terminal-based password manager, generator, and importer/exporter (Firefox, Chrome) backed with a concurrent hashmap

Usage: rucksack [OPTIONS] [COMMAND]

Commands:
  add     add a new secret
  export  export the rucksack db
  gen     generate a secret
  import  pull in creds from other sources
  list    list all secrets
  rm      delete a single record
  set     perform various 'write' operations
  show    display rucksack-specific information
  help    Print this message or the help of the given subcommand(s)

Options:
      --completions <SHELL>  emit shell tab completions [possible values: bash, elvish, fish, powershell, zsh]
  -v, --version              Print version information
  -h, --help                 Print help

Password Generator

Use a UUID:

rucksack gen --type uuid

New password: 229ef9b4-b95b-4d91-a6ac-f6b7ef1cfc47
Password score: 88.50

Augmented UUID:

rucksack gen --type uuid++

New password: 4C7360%E-4@60-4?03-b559-491C8A52E750
Password score: 100.00

Random:

rucksack gen --type random

New password: A&6YU?#xk.?)
Password score: 91.22

Lorem-ipsum inspired:

rucksack gen --type lipsum

New password: Esse-maius-amicitia,-nihil.-]9^,
Password score: 100.00

Some systems can't handle special characters, so a flag is available for encoding with base64, with the generated encoding getting scored:

rucksack gen --type lipsum --encode

New password: VmVydW0sLW9waW5vciwtc2NyaXB0b3JlbS10YW1lbi4tLjYrfQ
Password score: 100.00

Importing and Exporting

Import login data from Firefox Sync:

rucksack import \
  --db-pass abc123 \
  --type firefox \
  --file ~/Downloads/logins.csv

Logins may be exported to files that can then be used to import into browsers:

rucksack export \
  --db-pass abc123 \
  --type chrome \
  --file /tmp/exported-logins.csv

For both importing and exporting, there are currently two supported types: firefox and chrome.

Adding and Updating via Command

To add a single record via the CLI:

rucksack add \
  --url http://example.com \
  --user shelly \
  --password whyyyyyy

Note that --user and --url are required when adding a new record. A password is required, too: if one is not provided with --password, then you will be prompted:

rucksack add \
  --url http://example.com \
  --user shelly
Enter db password:
Enter password for record:

There are several types of changes to records that can't be made via an "update" subcommand due to how the data is used in the database. That did't leave too much data left for an "update" command, so the "record type" update was moved into the "set" group, too. The total list of set operations is:

  • changing the password
  • changing the user (account name)
  • changing the URL
  • changing the type of record

As such, these have their own sub commands (under set), as well as their flags and logic.

Changing a password:

rucksack set password \
  --url http://example.com \
  --user shelly
  --password whyyyyyyyyyyyyyyyyyyy

If the password isn't provided, you will be prompted at the terminal:

Enter account password:

Changing a user:

rucksack set user \
  --url http://example.com \
  --old-user shelly
  --new-user clammy

Changing a URL:

rucksack set url \
  --old-url http://example.com \
  --new-url http://shelly.com \
  --user clammy

Changing the record type:

rucksack set type \
  --url http://example.com \
  --user clammy
  --type account

Note that for all of this, should you want to pass the DB password, file, or salt, you will need to make sure those flags come after set but before the following subcommmand.

List Secrets

Show URL/accounts for all secrets:

rucksack list
Enter db password:

Show URLs, accounts, passwords, and password scores for all secrets:

rucksack list --decrypt
Enter db password:

In both cases a password may be passed with the --db-pass flag. By default, the salt is the value of the USER environment variable, but it may be overridden with the --salt flag.

Note that without --decrypt, only the user and URL are displayed. With --decrypt, those as well as masked password and password score are displayed. To unmask the password, one must also set --reveal.

The default database location depends upon operating system. To see the location for your system, you can run rucksack show db-file. To use another location, the --db flag is available.

The flags --db, --db-pass, and --salt may be set for any subcommand that access the database.

Search / Filter Secrets

Simple filtering is also possible (done using a flag with the list command, with or without sorting):

rucksack list \
  --db-pass abc123 \
  --filter exa \
  --sort-by score \
  --decrypt
URL                                      | User / Account                 | Password             | Strength
-----------------------------------------+--------------------------------+----------------------+-----------
https://www.bugworld.com                 | hexapod123                     | **********           | 93
https://accounts.cloud.com               | [email protected]          | **********           | 90
https://entymology.slack.com             | [email protected]               | **********           | 86
https://bugs.slack.com                   | Alice "Hexapod" Roberts        | **********           | 85
https://twitter.com                      | TheOtherHexapod                | **********           | 83
https://portal-hexapod.testing.app       | [email protected]              | **********           | 58
http://localhost:3000                    | [email protected]              | **********           | 30

7 records (of 7 total)

It is also possible to perform negative filtering using --exclude. Additionally, --include is provided as an alias for --filter.

You may sort on score (strength), user, or url. If not provided, url sorting is used. Also note that order-by is provided as an alias for sort-by.

Grouping Results

By Password

For use in auditing, sites+user combinations that share the same password can be reported:

rucksack list \
  --group-by db-pass \
  --decrypt
+========================================================================

Password: ********** (Score: 99)
Accounts using: 5
Accounts:

URL                                      | User / Account
-----------------------------------------+-------------------------------
https://smile.amazon.com                 | [email protected]
https://smile.amazon.com/ap/signin       | [email protected]
https://www.amazon.com                   | [email protected]
https://www.amazon.com/ap/signin         | [email protected]
https://mybank.com                       | [email protected]

+========================================================================

Password: ********** (Score: 86)
Accounts using: 2
Accounts:

URL                                      | User / Account
-----------------------------------------+-------------------------------
https://blurp.com                        | alice
https://bleep.net                        | alice

2 groups (with 7 records out of 16 total)

By User

You may also group by user name (account name):

rucksack list \
  --group-by user \
  --decrypt

Debugging

If you need to see what version of the database file format your currently using:

rucksack show db-version

Note that this is not necessarily the version of rucksack you're running, rather it will correspond to the version of rucksack that was used when your secrets database was last updated.

Related

Other projects on crates.io tagged as #password-manager" ...

Projects of particular interest:

  • kbs2 - A secret manager backed by age
  • RustCrypto - A Github org collecting a handful of pure-Rust encryption libraries
  • Firefox Sync

License

Copyright © 2022-2023, Oxur Group

Apache License, Version 2.0

Comments
  • Add support for versioning schemas

    Add support for versioning schemas

    • [ ] All records need to be versioned:
      • [ ] Metadata
      • [ ] Creds
      • [ ] EncryptedRecord
      • [ ] DecryptedRecord
    • [ ] The DB struct itself needs to be versioned, too
    • [ ] The version to use needs to be configurable
    • [ ] Attempting to load records with with different versions than configured needs to err-out
    • [ ] Alternatively, the use may be prompted to upgrade and/or downgrade
    • [ ] Migrations to/from versions need to be supported
    • [ ] DBs and records of specific versions need to be easily created
    • [ ] Add an auto-upgrade flag to the CLI
    wontdo epic 
    opened by oubiwann 3
  • Improve CI/CD with one or more examples

    Improve CI/CD with one or more examples

    Tasks:

    • [ ] Create some examples:
      • [ ] password generation
      • [ ] import
      • [ ] export
      • [ ] adding one record
      • [ ] updating one record
      • [ ] removing one record
    • [ ] Update Makefile to include a target to run all examples
    • [ ] Add individual examples to CI/CD as part of the build process
    enhancement 
    opened by oubiwann 1
  • Rust docs not building

    Rust docs not building

    See log: https://docs.rs/crate/rucksack/0.4.1/builds/713859

    This is due to the fact that the container generating the docs on docs.rs doesn't have a USER env:

    src/cli/command/arg.rs:        .default_value(env!("USER"))
    
    bug 
    opened by oubiwann 1
  • Import logins from Chrome/Brave

    Import logins from Chrome/Brave

    These are also exported in CSV file format; should be trivial.

    Tasks:

    • [x] Implement the feature
    • [x] Update the README project desc
    • [x] Update the GH project desc
    • [x] Update the Cargo project desc
    feature 
    opened by oubiwann 1
  • Add a

    Add a "reveal" flag for listing password

    Right now, the --decrypt flag shows the passwords as well as their score. I'd like to be able to --decrypt, see the score, but not the password -- unless I explicitly ask for a --reveal.

    feature 
    opened by oubiwann 1
  • Encrypt protected data

    Encrypt protected data

    Encrypting strings with ring: https://gist.github.com/ru273/8cf21e5a59e65caf5cebc0318a2d25de

    Would be nice to define a struct and indicate which fields should be encrypted ... maybe secrecy can help with that?

    See: https://github.com/laysakura/serde-encrypt

    feature 
    opened by oubiwann 1
  • Data modeling secrets

    Data modeling secrets

    Using SurrealDB, we're looking at this, right now:

    CREATE secret SET
    type=password
    name='YYY',
    user='XXX',
    url='ZZZ',
    password='AAA',
    created=time::now(),
    updated='';
    

    Usage is like this:

    USER=alice
    PASS=abc123
    KEY=$(openssl enc -aes128 -k $PASS -md sha1 -P|grep key=|sed 's/key=//')
    echo $KEY
    surreal start --key $KEY --pass $PASS --strict --bind 0.0.0.0:5099 file://data/$USER
    
    DATA="INFO FOR DB;"
    curl --request POST \
    	--header "Accept: application/json" \
    	--header "NS: secrets" \
    	--header "DB: $USER" \
    	--user "$USER:$PASS" \
    	--data "${DATA}" \
    	http://localhost:5099/sql
    
    DATA="CREATE secret SET
    type=password
    name='YYY',
    user='XXX',
    url='ZZZ',
    password='AAA',
    created=time::now(),
    updated='';"
    
    curl -k -L -s --compressed POST \
    	--header "Accept: application/json" \
    	--header "NS: secrets" \
    	--header "DB: $USER" \
    	--user "$USER:$PASS" \
    	--data "${DATA}" \
    	http://localhost:5099/sql
    
    feature 
    opened by oubiwann 1
  • Support versioned database formats

    Support versioned database formats

    This works comes on the heels of several efforts:

    • #54 (won't do)
    • #59 (requires examining db files at the byte-level)
    • #48
    • #44

    All of these have led to me working on the following tasks:

    • [x] Tag our database files with version metadata
      • [x] create a wrapper struct for bytes and the current version
      • [x] refactor DB write code
      • [x] update the DB write to add an extra step of including the version metadata in the file
      • [x] refactor the DB read code
      • [x] update the DB read to properly parse the version metadata
    • [x] Add CLI commands for working with database file/format versions
    • [x] Create example databases in older formats and save them for use in tests
    • [ ] Add logic for parsing the version, and on error, attempting to open DBs in the old format
    • [x] #61
    feature 
    opened by oubiwann 2
  • Add `backup` subcommands

    Add `backup` subcommands

    Tasks:

    • [ ] Add a new backup command to the CLI
      • [ ] with no additional subcommands, perform a backup
        • for a non-daemonised instance, this is just a file copy
        • for a daemonized instance, this is a request issued to the server -- this depends upon #41
        • [ ] update #41 with this enhancement task
    • [ ] add a new backup list command so show all (including timestamp)
    • [ ] add a new backup restore command (by index or filename)
    • [ ] add a new backup delete command
    feature 
    opened by oubiwann 0
  • Create an fxa account client

    Create an fxa account client

    I think if we can't do it for this one, then we just bail and forget about it:

    • https://mozilla.github.io/application-services/book/rust-docs/fxa_client/index.html
    feature 
    opened by oubiwann 0
  • Database restores

    Database restores

    Features and/or tasks:

    • [ ] Update the App struct to include a field for the most recent backup filename
    • [ ] Refactor db.close() to pull out backup logic
      • [ ] create a new backup method
      • [ ] include the ability to include a tag for annoation (e.g., -backup--)
    • [ ] Add a backup method to the App struct
      • this will call the db's backup method
      • and set the App's latest_backup field
    • [ ] Add a replace method to the DB struct
      • this will accept a new dash_map as input
      • and replace the current in-memory dash_map on DB with the given one
    • [ ] Add a restore method on App
      • [ ] this will call db.replace passing app.latest_backup
      • [ ] it will also null out app.latest_backup
    • [ ] Add a restore_from_file method on App
      • [ ] this will call db.replace with the given file
      • [ ] it will also null out app.latest_backup
    • [ ] #48

    Blocks:

    • #41
    epic 
    opened by oubiwann 0
Releases(0.6.3)
  • 0.6.3(Jan 18, 2023)

  • 0.6.0(Jan 13, 2023)

    What's Changed

    • 0.6.0 Release by @oubiwann in https://github.com/oxur/rucksack/pull/45

    Full Changelog: https://github.com/oxur/rucksack/compare/0.5.0...0.6.0

    Source code(tar.gz)
    Source code(zip)
  • 0.5.0(Jan 7, 2023)

    What's Changed

    • Release 0.5.0 by @oubiwann in https://github.com/oxur/rucksack/pull/35

    Full Changelog: https://github.com/oxur/rucksack/compare/0.4.0...0.5.0

    Source code(tar.gz)
    Source code(zip)
  • 0.4.1(Jan 4, 2023)

  • 0.4.0(Jan 4, 2023)

    What's Changed

    • Release 0.4.0 by @oubiwann in https://github.com/oxur/rucksack/pull/26

    Full Changelog: https://github.com/oxur/rucksack/compare/0.3.0...0.4.0

    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Jan 2, 2023)

    What's Changed

    • Release/0.3.x by @oubiwann in https://github.com/oxur/rucksack/pull/18

    Full Changelog: https://github.com/oxur/rucksack/compare/0.2.0...0.3.0

    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Dec 31, 2022)

    What's Changed

    • Release 0.2.0 by @oubiwann in https://github.com/oxur/rucksack/pull/17

    Full Changelog: https://github.com/oxur/rucksack/compare/0.1.0...0.2.0

    Source code(tar.gz)
    Source code(zip)
  • 0.1.0(Dec 31, 2022)

    What's Changed

    • First release by @oubiwann in https://github.com/oxur/rucksack/pull/15

    New Contributors

    • @oubiwann made their first contribution in https://github.com/oxur/rucksack/pull/15

    Full Changelog: https://github.com/oxur/rucksack/commits/0.1.0

    Source code(tar.gz)
    Source code(zip)
Owner
Hues of Rust
null
A lightning-fast password generator and manager written in Rust

Passlane A lightning-fast password manager for the command line Features Generate passwords Place the generated password into the clipboard Save previ

Anssi Piirainen 4 Dec 15, 2022
Easily and securely share files from the command line. A fully featured Firefox Send client.

Notice: the default Send host is provided by @timvisee (info). Please consider to donate and help keep it running. ffsend Easily and securely share fi

Tim Visée 6.3k Dec 25, 2022
EXPERIMENTAL: Bitcoin Core Prometheus exporter based on User-Space, Statically Defined Tracing and eBPF.

bitcoind-observer An experimental Prometheus metric exporter for Bitcoin Core based on Userspace, Statically Defined Tracing and eBPF. This demo is ba

0xB10C 24 Nov 8, 2022
CLI password manager with encryption: AES256, Salsa20 and Chacha20, with cross platform and exclusive features

Keep My House (CLI) CLI password manager with encryption: AES256, Salsa20 and Chacha20, with cross platform and exclusive features Features AES256 GCM

null 4 Sep 7, 2023
The simple password manager for geeks, built with Rust.

Rooster Rooster is a simple password manager for geeks (it works in the terminal). Rooster is made available free of charge. You can support its devel

Conrad Kleinespel 131 Dec 25, 2022
🐴 RusTOTPony — CLI manager of one-time password generators aka Google Authenticator

?? RusTOTPony CLI manager of time-based one-time password generators. It is a desktop alternative for Google Authenticator. Installation Arch Linux Pa

German Lashevich 23 Jan 5, 2023
A simple password manager written in rust

Passman - A password manager written in rust. How to use?: USAGE: passman option Currently available options are: new - initalize passman with a new m

Strawkage 7 Aug 26, 2021
A simple password manager written in Rust

ripasso A simple password manager written in Rust. The root crate ripasso is a library for accessing and decrypting passwords stored in pass format (G

Joakim Lundborg 550 Dec 30, 2022
A password manager coded in rust

pasman A password manager coded in rust Install Dependency rust Shell git clone https://github.com/AMTitan/pasman.git cd pasman cargo build --release

Arthur Melton 4 Nov 8, 2021
The free password manager for power users

The free password manager for power users

null 312 Oct 22, 2022
A Password Manager Using age for Encryption

A Password Manager Using age for Encryption Contents Features Usage Install Import from pass How It Works Features It is inspired by pass. senior's fe

Retirement Home 3 Nov 2, 2023
Bitcoin PSBT signer, descriptor exporter and more for offline devices.

KeeChain Description KeeChain is a Bitcoin application to transform your offline computer in an AirGap Signing Device (aka Hardware Wallet). Getting s

Yuki Kishimoto 3 Dec 15, 2022
cargo-crev to cargo-vet code review exporter

cargo-crev to cargo-vet converter Crev and Vet are supply-chain security tools for auditing Rust/Cargo dependencies. This tool (crevette) is a helper

crev - Code REView system 3 Dec 6, 2023
Ruo is a dictionary-based password cracker written in rust 🦀 .

Ruo is a dictionary-based password cracker written in rust ?? . The primary purpose is to crack weak hashes/commonly used passwords.

Asjid Kalam 10 Mar 6, 2022
Rust-based password mutator for brute force attacks

PWFuzz-RS A Rust-based password mutator for brute force attacks Disclaimer This tool works, but was mainly an experiment. Please do not expect frequen

Michael Taggart 6 Oct 31, 2022
Mundane is a Rust cryptography library backed by BoringSSL that is difficult to misuse, ergonomic, and performant (in that order).

Mundane Mundane is a Rust cryptography library backed by BoringSSL that is difficult to misuse, ergonomic, and performant (in that order). Issues and

Google 1.1k Jan 3, 2023
WIP, POC of node js driver for pulsar backed by rust

WIP not ready at all, POC for node js rurt based pulsar driver pulsar-node-rust-client This project was bootstrapped by create-neon. Installing pulsar

Clever Cloud 6 Aug 10, 2022
A safe implementation of the secure remote password authentication and key-exchange protocol (SRP), SRP6a and legacy are as features available.

Secure Remote Password (SRP 6 / 6a) A safe implementation of the secure remote password authentication and key-exchange protocol (SRP version 6a). Ver

Sven Assmann 10 Nov 3, 2022
A blazingly fast and memory safe password cracker with user interface.

HashVat A blazingly fast and memory safe password cracker with user interface. HashVat runs with user interface and is capable of cracking the 1.000.0

JBLDSKY 2 Dec 6, 2022