I am a bit confused about key derivation functions. I am trying to use the
argon2 KDF from the
passlib python module to do the following:
- The user provides a password which I provide to the hash function combined with a salt (which is autogenerated by the function)
- I use the resulting hash as a master key to encrypt some other key(s) along with some data about some system, for example a set of files. The salt is also stored along this data (but not encrypted).
My confusion comes from the fact that the library only provides the hash results in the form of strings which may be used to identify if the user of some website typed in the correct password, for example the string
as shown in this example.
Can I use a KDF like
argon2 for this purpose? Of course I would have to extract the key and the salt along with the settings from this string to make this work.