password generator, storage and reference for the terminal and/or X.
- I can create passwords
- / / recall passwords
- / / update passwords
- / / delete accounts
- / / import a csv file
- / / export a csv file
1.1 Using terminal
1.2 Using dialog, cdialog
1.3 Using Xdialog
1.4 Using zenity
1.5 Using yad
- bashpass
main script
- srcs
Accompanied functions.
Namely general, backend and ?UI specific
- examples
Create DB script and import example files.
- create.sql
SQLite database create example script
- import.csv
Accounts import example format
- create.sql
- test.bats
Bats tests file.
Needs bats installed to run.
- readme.org
This file
- license
A License
- GNU/BSD based distro
- BASH v4
A recent Bash installation with a major version no less than 4.
- SQLite v3
SQLite3 installed and
sqlite3
available in${PATH}.
- GNU Privacy Guard
You need gnupg installed,
gpg2
orgpg
executable readily available in${PATH}.
- Optionally…
- yad,zenity,Xdialog for an X client.
- cdialog,dialog for a tty TUI.
- finally, xclip for some middle click password pasting functionality.
- This author makes no claims, guarantees or promises of any kind.
- This project is nothing more than a UI/CRUD/SQL/PGP playground.
- Not tested for production use at any load or capacity.
- This script assumes you can secure the safety of your computer hardware/software at least for the duration of its operations.
- There is no backwards compatibility maintanance plan between batabases of different versions of this script.
So if you thinking of a git pull/fetch, make sure to hit that csv export menu option first.
4.2 gpg2 keyring
If you don’t already have one, make a gpg2 keyring.
bashpass [default.gpg] [yad|zenity|Xdialog|cdialog|dialog|terminal] [--debug] [--help]
- You can provide a gpg2 encrypted SQLite3 database create script for use with
bashpass
.(It is the same file that SQLite3 will output when given the
.dump
command).That script needs to be encrypted to your personal keyring, have a
.gpg
extension and reside in dbs folder.If no such option is given the script will use
default.gpg
.If no such file is available (eg: first time use, new db request) it’ll be created.
You can only have one instance of each
*.gpg
file open at any given time for obvious reasons.This is internally enforced by MUTEX implementation.
- If you’d like to test other UI options try:
bashpass [yad|zenity|Xdialog|cdialog|dialog]
, needless to say they have to be installed.If not,
bashpass
will default to the highest available option in that order. - The
debug
option willset -vx
tobashpass
, enabling it to echo commands in the terminal.To say the least: It’s noisy!
- Help will print Usage and exit.
- Consider launching bashpass with launch from terminal option enabled
(where available, eg in dmenu:
xterm -hold -e /path/to/bashpass [default.gpg]
)as it will not run otherwise.
For SQLite session availability (highly insecure), gnupg input and debugging purposes.
- Passwords generated by bashpass are 16 character long
[:graph:]
typerandom strings from
/dev/urandom
, with some exceptions:\ `$|,'"
,namely: backslash, backtick, pound, colon, comma, quotes(both).
Create, Retrieve and Update operations selected password will be copied to
XA_PRIMARY
xclip target (pasteable with middle mouse button),
with it’s trailing newline (‘\n’) removed.
Depending on the environment. Based on availability Based on X Done. Central null value handling for various ?UIs list building consistency.Moved to ${be} insert function.
For security reasonsDone!
Add a menu option for pass (password-store) compatibility mode
Source a l10n.src
file that will feed translated strings according to ${LANG}
settings.
Like: csv, xml, json etc…
This repo may help: structured-text-tools
Depending on xclip availability and on single record operations,
you’ll be able to paste affected passwords via middle-click.
setup
script went BB and got replaced with func_setup
,
for less repeated code and a more compact design.
Changes to gpg2 encryption options.
You can launch bashpass like so:
BP_KEY=”my@email.net” ./bashpass mygpgfile.gpg # or
BP_EML=”my@email.net” ./bashpass mygpgfile.gpg
Alternatively use an RC file to store email details,
see .bashpass.rc.example and don’t forget to rename it to use it:
echo "BP_KEY=\"my@email.net\"" > .bashpass.rc
$BP_KEY will encrypt to your personal keyring, or
echo "BP_EML=\"my@email.net\"" > .bashpass.rc
$BP_EML will encrypt with a conventional symmetric algorithm.
On RC file and envar absence this script will default
to symmetric encryption to a gpg key provided by you (via gpg2 prompt).
Another small detail that could lead to misconceptions:
RC file should be located in bashpass
’s dirname folder (as all other relative files)
and not ${HOME} or ${XDG_CONFIG_HOME:-${HOME}/.config}.
So this time literally, It’s not a bug… It’s a feature!
From now on the update function will be able to modify all available account fields, not only passwords.
Basic data input validation for all account fields has been implemented (see Notes #3, No \ `$|,'"
chars.)
Persistant edits have been implemented.
On create/update functions on charachter validity/password mismatch errors
the user will be returned to create/update forms to trouble-shoot accordingly with his edits preserved.
The default option thus far was to repeat the proccess from scratch.
Zenity:
No way to set default values on zenity forms,
so with that in mind, an editable list was the best way to go.
For security reasons SQLite3 will work in :memory: mode only.
Basic file checks for csv import/export functions impemented.
Typos, syntactic and grammar welcome, other than that all PR’s will be reviewed.
In the rare case that you really must contribute, feel free
to buy me some coffee in € or ₿ (bitcoin:19TznUEx2QZF6hQxL64bf3x15VWNy8Xitm).