crypto-browserify
crypto-browserify copied to clipboard
crypto.constants = undefined
When using crypto-browserify or just browserify to require crypto i want to use the following:
const encryptedData = crypto.publicEncrypt({
key: `some public key`,
padding: crypto.constants.RSA_PKCS1_OAEP_PADDING,
oaepHash: "sha256",
},
Buffer.from(password) // We convert the data string to a buffer using `Buffer.from` so we can manipulate the data using publicEncrypt
)
But crypto.constants = undefined so I'm not sure what to do?
This issue has also been mentioned on browserify here and was requested to be moved to this repo as well.
https://github.com/crypto-browserify/crypto-browserify/blob/460a13b5bf1e4ea60dc995906ba0543f7933a32b/index.js#L81