The documentation should stress that cryptographically random keys must be used with the library. For example, advise users to run something like the following to create a new key:
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
In addition, strings passed by the user probably shouldn't be used directly as keys. Either advise users to pass real byte arrays of the right size, or run inputs through PBKDF2 to generate keys of the required size.
The documentation should stress that cryptographically random keys must be used with the library. For example, advise users to run something like the following to create a new key:
In addition, strings passed by the user probably shouldn't be used directly as keys. Either advise users to pass real byte arrays of the right size, or run inputs through PBKDF2 to generate keys of the required size.