Serializes the encrypted payload as a string of text for easy storage.
Uses browser native crypto to be the lightest possible module you can have, with the most vetted internals you could ask for (the real guts here are implemented by the browser provider).
You need to have node.js installed.
npm install browser-passworder
var passworder =var secrets = coolStuff: 'all' ssn: 'livin large'var password = 'hunter55'passworder
There are also some more advanced internal methods you can choose to use, but that's the basic version of it.
The most advanced alternate usage would be if you want to cache the password-derived key to speed up performance for many encryptions/decryptions with the same password.
The serialized text is stored as a JSON blob that includes two base64-encoded fields,
iv, neither of which you need to worry about.
The data is encrypted using the
AES-GCM algorithm. It is salted with the result of
crypto.getRandomValues(), and the encryption vector is generated the same way.