README
¶
pass
what is this project?
This is a password manager run entirely in the terminal.
In the manager, and in this README, I have used #
to represent a number and str
to represent any random characters.
starting for the first time
Download all of the files (except the example folder of screenshots) into a folder called pass
. Make sure there is a folder within pass
called encrypt
that encrypt.go
is in. This is necessary as encrypt.go
is imported for several different files.
Use the createEncr.go
file to create and encrypt your file of password the first time. In all future times, you can just run pass.go
and all should work.
There is also changeKey.go
for decrypting the file and then encrypting it with a different key, in order to change your password or key parameters.
tview and visuals
I used the TUI tview. I used four types of primitives: input fields, lists, text boxes, and forms. In order to format them, I used flexes, pages, and grids. I used grids only to add borders around the primitives.
The majority of the code is anonymous functions inside of func main in order to set up the primitives.
I coded it for a 84x28 window size with a text font of monaco, size 18. I chose this window size because it best fit the three columns for /list
and /find
with that font size.
It will work with all fonts (to my knowledge), however you may not be able to see all the items without scrolling or pressing the tab. If your font is bigger than monaco size 18, then you should use a bigger window size.
encryption and file writing
All of the entries are marshaled as if they were going to be written to a yaml file. Instead, that byte slice is entirely encrypted before being written to the file. Then, when reading from the file, the byte slice is decrypted and turned into the slice of entries. Therefore, the password to the password manager must be put in at the beginning before accessing any of the commands.
Argon2 is used to make a key and then the entries are encrypted with AES-256.
The way that the program knows if you put in the right password is if it can unmarshal the data successfully.
This password manager is unsuitable for cloud computing or a shared computer as the decrypted information is stored in the memory.
The encryption is in the file encrypt.go
which must be in a folder called encrypt inside the greater pass folder as that is how the imports work. encrypt.go
gets imported into not just pass.go
but the files for setting up the program.
commands
This section is about all of the actions that can be done with the password manager. All of the commands are called through the command line at the bottom.
/home
/home
is the starting screen once you’ve logged in. There’s nothing going on yet. The text on the right details the possible commands.
/help
/help
is similar to this README but it is condensed and in the password manager itself for ease of access.
/open #
/open
is used to view an entry. It will include time information that is known. Passwords and security questions have their values printed in black text. Therefore, one can highlight it to see the values.
/copen #
/copen
is also used to view an entry. It is a list that is used to copy the data to the clipboard. With /copen
, you select one of the fields and it copies itself to your clipboard.
/new
\new
has a form at the top with two input fields for the entry name and its tags. Then there are buttons for making a new field (username, password, or security question), saving, quitting, deleting, and making notes.
You must name the entry in order to save it.
There is no limit to the number of usernames, passwords, or security questions you can make. They are all encrypted the same, except the values for passwords and security questions are blotted out when viewed.
/copy #
/copy
is the same as /new
except fields are already filled in with the information of entry #.
/edit #
/edit
is used for editing an entry already made. It is a list with each field of the entry. You can select a field and then edit that specific one.
/find str
/find
is used to search the name and tags of all the entries for a string. It then returns the list of entries that contain that string. The entries are printed out following the same format as /list
. The example above is searching for “ak”.
/list
/list
is used to list all of the entries. /list is useful to see the index number of an entry to open it. /list
prints the entries in three columns of a fixed size, therefore the entry name can get cut off. This is done with a single text box, using some string and math trickery.
/pick
and /picc
/pick
and /picc
look mostly identical. They are lists of all the entries, like /list
, except you can select and open an entry. /pick
will /open
an entry while /picc
will /copen
an entry.
/comp # #
/comp # #
looks for duplicate passwords or answers to security questions between two entries.
/reused
/reused
shows any duplicate passwords or answers to security questions from all of the entries. The passwords (or answers) are printed in dark gray, but one can use their mouse to select the text to read it more clearly if needed.
miscellaneous info
mouse usage and clipboard
When the mouse is enabled in tview in order to change the focus or click buttons, one cannot select and copy any text.
For ease of copying, there is /copen #
which uses tview.List, where you select one of the fields and it copies to your clipboard.
time values
Times are saved for the date created, date last modified, and the date last opened.
Date last modified is only updated if any edits are made and saved in /edit
.
Date last opened is modified if the entry is opened by /open #
or /copen #
.
These dates also work as security in case you notice irregularities.
circulation
In each entry there is a boolean named Circulate
which determines if the entry shows up in /list
, /pick
, and /picc
. All commands that work on entries still work (/edit
, /open
, /copy
, etc.). This can be used to reduce clutter of old entries without changing the entry numbers of later ones.
Documentation
¶
There is no documentation for this package.