browserify / browserify/crypto-browserify

crypto.constants = undefined

Open
#193 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
681
Forks
209
PR merge metrics
No merged PRs in 30d

Description

When using crypto-browserify or just browserify to require crypto i want to use the following:

```js
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](https://github.com/browserify/browserify/issues/1964) and was requested to be moved to this repo as well.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.