Kunzisoft / KeePassDX

Lightweight vault and password manager for Android, KeePassDX allows editing encrypted data in a single file in KeePass format and fill in the forms in a secure way.
https://www.keepassdx.com/
GNU General Public License v3.0
4.71k stars 276 forks source link

Vault encryption: what is the best "recipe" to stay safe? #1662

Closed serrq closed 1 year ago

serrq commented 1 year ago

Following my current recipe. I'd like to stay future proof if possible. What can I improve?

• Encryption algorithm

Rijndael (AES)

• Key derivation function

(AES)

• Transformation rounds

500000

• Memory usage

(Empty)

• Parallelism

(Empty)

J-Jamet commented 1 year ago

It's always a question of balancing security and usability. If you want the best security, put all the numbers to the maximum but you will not be able to open your database either because it will take way too long.

shuvashish76 commented 9 months ago

According to OWASP (a nonprofit foundation that works to improve the security of software) Argon2id is best. Parameters recommendations as of May 2023 : https://en.wikipedia.org/wiki/Argon2#Recommended_minimum_parameters Original article : https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#argon2id

But both KeePass & KeePassXC recommends Argon2

The main advantage of Argon2 over AES-KDF is that it provides a better resistance against GPU/ASIC attacks (due to being a memory-hard function).

In the case of KeePass, we currently recommend Argon2d instead of Argon2id, because we believe that a better protection against a really existing threat (password cracking using GPUs/ASICs is state of the art) is more important than a protection against certain side-channel attacks that may or may not become a problem on client devices in the future. If you worry about side-channel attacks (and are willing to sacrifice some GPU/ASIC resistance) or if you are developing a software where side-channel attacks could be a problem (e.g. a server service that operates with KeePass database files), use Argon2id.

Side note: the IRTF CFRG Argon2 Internet standard recommends Argon2id by default. For server applications, Argon2id is in general indeed more suitable than Argon2d, but our situation (client device) is different, as mentioned above.

Source: https://keepass.info/help/base/security.html#secdictprotect

serrq commented 9 months ago

Thanks.

For database encryption what is the best?

• Rijndael (AES) • Twofish • ChaCha20

shuvashish76 commented 9 months ago

According to KeePass

AES (Rijndael) became effective as a U.S. federal government standard and is approved by the National Security Agency (NSA) for top secret information. Twofish was one of the other four AES finalists. ChaCha20 is the successor of the Salsa20 algorithm (which is included in the eSTREAM portfolio).

Reference:

~ Bruce Schneier (one of the authors of the Twofish algorithm)


I don't have much info about ChaCha20 besides its a new algorithm & not widely used. I've read some comments here & there (e.g reddit) but they're not reliable source. I've no technical background to understand information mentioned about it in Wikipedia.

serrq commented 9 months ago

I temporarily set my database encryption on ChaCha20. I heard it has been used on some instant messengers e2ee.