Simple proof of concept of how to use PBKDF2 to derive key for symmetirc de/encryption.
encrypting
- get user password
- derive key wit PBKDF2
- use key to symetrically encrpyt plain text
decrypting
- get user password
- derive key wit PBKDF2
- use key to decrypt cyphertext
Encrypt data without sending password to the server.
Encrypt private key with password.
This code is not safe for production. Use different configurations for config.salt
and config.iv
. Make sure, these configurations enable a strong security.