I would like to encrypt some sensitive files on my computer and smartphone so that they remain unreadable even if the computer is stolen.
So far as I'm concerned, AES is the best encryption algorithm, so I would go for it. For the AES, I also need a secret key (or cipher key). Therefore, I need a key derivation function, preferably a password-based one. Obviously, I do not want to store the derived secret key on the computer (or smartphone), otherwise, the encrypted text could be easily decrypted using the secret key.
I have read that Argon2 is considered the best choice for password-based key derivation these days.
Now, in the "argon2 cffi Documentation Release 19.1.0" (January 17, 2019) I have read that "Argon2i uses data-independent memory access, which is preferred for password hashing and password-based key derivation" (page 3). Then, on page 9 I read the very same words about Argon2id: "That makes it [Argon2id] the preferred type for password hashing and password-based key derivation".
Now my first question is: Which of the two types of Argon2 is the best for password-based key derivation?
Further, as per the same document, the argon2.PasswordHasher algorithm "always uses a random salt for hashing". This implies that every time I enter my password to decrypt the file, the hashing algorithm will produce different secret keys, so in no way can I reproduce the secret key to decrypt my file.
Of course, I can store the salt on the computer (or smartphone) but then two other questions arise:
How can I use Argon2 with a predefined salt?
Is there a point in using a salt that is freely accessible (if my data are stolen)?
So, can somebody shed light on how Argon2 can be used as a password-based key derivation function? And what would be the solution to my problem?