fastpass

package module
v0.0.0-...-a7e59ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 17 Imported by: 0

README

FastPass

(it's not like the disney thing)

FastPass or fp is a command line password manager focused on getting you logged in quickly.

It uses fuzzy searching and learns which passwords you retrieve most frequently.

By default it generates easy to remember passwords using human words.

Table of Contents

Example

$ fp p
similar: ammarb@pizzahut.com ammarb@promhub.com 
Copied password for ammarb@papajohns.com

You should take care in making sure the right password is matched.

Install

go get -u github.com/s-kirby/fastpass/cmd/fp

Features

  • Encryption
  • Fuzzy searching
  • Notes
  • Ranking based on access frequency
  • Master password and key file support
  • Key generated from master password caching
  • Change master password
  • Passwords are streched with pbkdf2/sha256 using 65536 iterations
  • Multiple password generation strategies

Smart searching

fp uses both password frequency and levenshtein distance distance from search to retrieve the best entry.

For example:

$ fp ls reddit
------------
/tmp/test.db: 5 entries
------------
usr1@reddit.com      [activity:003 created:04/03/2017 06:54:31]
usr2@reddit.com      [activity:000 created:04/03/2017 06:54:34]
ammarb@papajohns.com [activity:003 created:04/03/2017 06:53:29]
ammarb@pizzahut.com  [activity:000 created:04/03/2017 06:53:22]
ammarb@promhub.com   [activity:000 created:04/03/2017 06:53:37]
$ fp reddit
similar: usr2@reddit.com ammarb@papajohns.com ammarb@pizzahut.com ammarb@promhub.com 
Copied password for usr1@reddit.com

Generators

Human

The human password generator uses the lists in passgen/world_list/ to generate passwords.

It uses the following format: <Adjective><Adjective><Noun><Noun><random num [000, 1000)>

It generates about 55 bits of entropy.

Hex

Hex generates 16 random hex digits.

It generates 64 bits of entropy.

Base62

Base62 generates 16 random base62 digits.

It generates 96 bits of entropy.

Password caching

fp caches secrets after an open in /dev/shm/fp-<username>.secret

FastPass imports and recommends the following name format, all lowercase.

[category/...]<username>@<url/service>

Autocompletion

Add the following to your ~/.bashrc for autocompletion support

__fp_ls() {
       COMPREPLY=()
       cur=${COMP_WORDS[COMP_CWORD]}
       if (($COMP_CWORD == 1)) {
          COMPREPLY=( $( compgen -W '$(fp --bash ls)' -- $cur ) )
       }
}
complete -F __fp_ls fp

Documentation

Index

Constants

View Source
const (
	NextHalfInc = time.Hour * 24 * 7
)

halving parameters

Variables

This section is empty.

Functions

func GetPassword

func GetPassword() (key [32]byte)

GetPassword retrieves a password from the command line. It returns the the stretched representation of the password using pbkdf2.

Types

type Entries

type Entries []*Entry

Entries is a set of entries

func (Entries) DeleteByName

func (es Entries) DeleteByName(name string) (cleaned Entries)

DeleteByName deletes an entry from es and returns the new slice

func (Entries) FindByName

func (es Entries) FindByName(name string) *Entry

FindByName finds an entry by it's name. It returns nil if no entry was found.

func (Entries) FuzzyMatch

func (es Entries) FuzzyMatch(search string) (ret Entries)

FuzzyMatch returns all entries with names fuzzy matching search

func (Entries) SortByBestMatch

func (es Entries) SortByBestMatch(search string) Entries

SortByBestMatch tries to sort entries by best match

func (Entries) SortByHits

func (es Entries) SortByHits() Entries

SortByHits sorts es by hits

func (Entries) SortByName

func (es Entries) SortByName() Entries

SortByName sorts es by name

type Entry

type Entry struct {
	Name      string
	Password  string
	CreatedAt time.Time
	Stats     Stats
	Notes     string
}

Entry is a fastpass entry

type FastPass

type FastPass struct {
	Key     [32]byte
	Entries Entries
	// contains filtered or unexported fields
}

FastPass is a fastpass service

func New

func New() *FastPass

New returns an instantiated fastpass

func (*FastPass) Close

func (fp *FastPass) Close() error

Close flushes and invalidates fp

func (*FastPass) Create

func (fp *FastPass) Create(path string) (err error)

Create a new fastpass database. it sets fp to the new database.

func (*FastPass) Flush

func (fp *FastPass) Flush() error

Flush flushes the database to disk

func (*FastPass) Open

func (fp *FastPass) Open(path string) (err error)

Open opens a database

type Stats

type Stats struct {
	//Activity should not be incremented directly
	Activity int
	//NextHalfInc is added to NextHalf every hit, up to maxNextHalf
	//It's goal is to prevent entries that are no longer frequently accessed from
	//being actively selected
	NextHalf time.Time
}

Stats contains stats about an entry's access.

func (*Stats) Hit

func (s *Stats) Hit()

Hit adds a hit to s

Directories

Path Synopsis
cmd
fp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL