Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto.constants = undefined #193

Open
futurelucas4502 opened this issue Aug 7, 2020 · 1 comment
Open

crypto.constants = undefined #193

futurelucas4502 opened this issue Aug 7, 2020 · 1 comment

Comments

@futurelucas4502
Copy link

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.

@futurelucas4502 futurelucas4502 changed the title crypto.constants = undefined when using const crypto = require("crypto") crypto.constants = undefined Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants