d7a887766c
Allow applications to skip the PBKDF2 operation if they already have a cryptographically secure key, instead using a simple HKDF to derive a key. In order to maintain compatibility for existing element-web sessions, if we discover that we have an existing store that was encrypted with a key derived from PBKDF2, then we reconstruct what element-web used to do: specifically, we base64-encode the key to obtain the "passphrase" that was previously passed in. If that matches, we know we've got the right key, and can update the meta store accordingly. Part of a resolution to element-hq/element-web#26821. Signed-off-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Co-authored-by: Damir Jelić <poljar@termina.org.uk>