diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2023-09-01 00:00:00 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2023-09-01 00:00:00 +0000 |
| commit | 96660a90e4cd296a2922d7a547de4cd9d0b1928b (patch) | |
| tree | e5216e22ee1a3e1653d8d1ecd856f4f03615d6a1 /Cargo.toml | |
| parent | 6423baebd92e45c9be85157c443dff42e65d8d14 (diff) | |
feat(login) password login using encrypted nsec
Enables the user to only handle the nsec upon first use of the tool
by encrypting it with a password and storing it on disk in an
application cache.
The approach to encryption draws heavily from that used by the gossip
nostr client.
- unencrypted nsec is zeroed from memory
- a salt is used to defend against rainbow tables
- computationally expensive key stretching defends against
brute-force attacks of passwords with low entropy.
There is UX trade-off between decryption speed and key-stretching
computation. This UX challenge is exacerbated in a cli tool as
decryption must take place more regularly. Thought was put into the
selected n_log and a heavily reduced value is provided for long
passwords where security benefits are smaller.
A more granular reducing in computation was also considered by
rejected to avoided to revealing just how weak a password is as most
weak passwords are reused.
Diffstat (limited to 'Cargo.toml')
| -rw-r--r-- | Cargo.toml | 8 |
1 files changed, 8 insertions, 0 deletions
| @@ -13,16 +13,24 @@ categories = ["command-line-utilities","git"] | |||
| 13 | 13 | ||
| 14 | [dependencies] | 14 | [dependencies] |
| 15 | anyhow = "1.0.75" | 15 | anyhow = "1.0.75" |
| 16 | chacha20poly1305 = "0.10.1" | ||
| 16 | clap = { version = "4.3.19", features = ["derive"] } | 17 | clap = { version = "4.3.19", features = ["derive"] } |
| 17 | dialoguer = "0.10.4" | 18 | dialoguer = "0.10.4" |
| 18 | directories = "5.0.1" | 19 | directories = "5.0.1" |
| 20 | keyring = "2.0.5" | ||
| 21 | nostr = "0.23.0" | ||
| 22 | passwords = "3.1.13" | ||
| 23 | scrypt = "0.11.0" | ||
| 19 | serde = { version = "1.0.181", features = ["derive"] } | 24 | serde = { version = "1.0.181", features = ["derive"] } |
| 20 | serde_json = "1.0.105" | 25 | serde_json = "1.0.105" |
| 26 | zeroize = "1.6.0" | ||
| 21 | 27 | ||
| 22 | [dev-dependencies] | 28 | [dev-dependencies] |
| 23 | assert_cmd = "2.0.12" | 29 | assert_cmd = "2.0.12" |
| 24 | duplicate = "1.0.0" | 30 | duplicate = "1.0.0" |
| 25 | mockall = "0.11.4" | 31 | mockall = "0.11.4" |
| 32 | once_cell = "1.18.0" | ||
| 33 | rexpect = "0.5.0" | ||
| 26 | serial_test = "2.0.0" | 34 | serial_test = "2.0.0" |
| 27 | test_utils = { path = "test_utils" } | 35 | test_utils = { path = "test_utils" } |
| 28 | 36 | ||