bitwarden-rofi
bitwarden-rofi copied to clipboard
Add caching of items to reduce loading time
Adresses issue #51: went from ~1.09s
to ~0.31s
for me.
Some comments:
- write
ITEMS
to caching file (/tmp/bwmenu/logins.gpg
) - file is encrypted using
gpg
default algorithm (AES256
, which is used by BW)- could change with
--cipher algo
(see available options withgpg --version
- passphrase is the
BW_HASH
, since having the session key would also grant access to the vault ofbw
(?)
- could change with
This is looking good! I have one question however, why did you decide to move the cache file from ~/.cache to /tmp?
Glad you like!
I moved to /tmp/
in order to make the encrypted logins more temporary. Once you logout of bwmenu
, the BW_HASH
is unusable for bwmenu
itself. But with access to the logins.gpg
would still yield great danger. This is not solved, by moving to /tmp
but a little better. Ideally the logins.gpg
should be safely shred
after logout?
I'm not sure if this is really an issue. If an attacker has access to the BW_HASH
, he prolly has already serious control.
Edit: My first approach was to only store the item names without the passwords.
Then I would load the item names and load_items() &
in subshell. However I didn't find a satisfying solution to access the items again in the original shell, without some FIFO
or such. Thus I opted for the login.gpg
.
It could be solved with more powerful threading options, which bash
doesn't offer I think.
Is there anything preventing you from merging this? I tested it out and the improvement in loading times is great :)
Sorry, did some Git wobbling :grin:
Bump
Thanks again! This is an awesome improvement to the speed. merge in 61a9e68