Security of the encrypted notes #1
Labels
No milestone
No project
No assignees
1 participant
Notifications
Total time spent: 46 minutes 13 seconds
Due date
sofia
46 minutes 13 seconds
No due date set.
Dependencies
No dependencies set.
Reference: sofia/note-taking#1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, notes are encrypted using pwbox which is a crate that enables password-based encryption and decryption.
This is fine, but I have a few things that I want to answer/resolve:
Yes, but this is prevented using a KDF on newer databases.
Using a basic entropy function (
E = L * log2(R)
, whereE
is the entropy,L
is the password length andR
is the quantity of unique characters), seems like a good entropy value is higher than 60. But this function under-represents the importance of dictionary-based attacks, which are more valuable after the implementation of a KDF.Yes, partially (see #issuecomment-14).
Yes, it is a good idea to show that to the user, and has been already implemented (
b051b923fd
)Another alternative would be to salt/hash the password: that way dictionary-based attacks could be made more difficult.
Related information:
This comment showcases case studies, example implementations, or things related to the issue.
E = L * log2(R)
, whereE
is the entropy,L
is the password length, andR
is quantity of unique characters.Chosen solution (modified from
f4b5a0541d
):Reopening due to unsolved questions.
Chosen solution (modified from
b051b923fd
):The remaining thing to answer is: "Should the usage of a "good" password be enforced?".
This is quite difficult to answer, because there are many things to take into account:
The past has shown that arbitrary limitations (requirement of lowercase and uppercase characters and the like) actually helps attackers to create better brute-force attacks. On contrast, the enforcement of basic limitations (minimum of 12 characters and the like) does actually help to protect the password.
The thing with any limitation is that it puts more burden on the people, which means that bad practice could be encouraged as a side effect (for example, saving the password on a .txt, saving the password on a piece of paper, etc).
We have to find the sweet spot between enforcing security and reducing the burden on people.
We could enforce just basic security practices (12 character passwords) and give the people the tools to assess the security of the given password (entropy values with a color indicator, etc). Because that's actually what arbitrary limitations tried, but failed to do so.
Another thing to consider is the possibility of password-less keys: pairing the password with technology like certificated, hardware keys, OTP, and things like that. That way there is a great protection against brute-force attacks because of the requirement of 2FA, but the user is able to "forget" the password if law enforcement or any bad actor asks the user to hand it over. (Which is also another thing of its own: defining the attack vectors that this app protects against and designing it to be zero-trust in future iterations).
To summarize, the answer to those questions would be: