You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I am trying to encrypt data using public key from backend in the browser. Since it's not https, I can't really use crypto.subtle. I've tryed bundling with browserify with no success. I ended up using rollup:
But something is not right. When encrypting it shows this error message:
const key = new NodeRSA()
const publicKey = `-----BEGIN PUBLIC KEY-----
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAI6YyPTvCoQdVdmQh7BhweUthE3klCL9
FvPCHDTl2TGSQJyv3D/v6w8fJDDzOMziow+oEia46VSNWjkp75iZXO8CAwEAAQ==
-----END PUBLIC KEY-----`
key.importKey(publicKey, 'public')
let e = key.encrypt('hello you')
Uncaught Error: Error during encryption. Original error: TypeError: crypt.createHash is not a function
at NodeRSA.$$encryptKey (:10496:31)
at NodeRSA.encrypt (:10451:33)
at :1:13
Is the bundling missing something? (also, couldn't a browser single file version be included in future releases?)
The text was updated successfully, but these errors were encountered:
So I am trying to encrypt data using public key from backend in the browser. Since it's not https, I can't really use crypto.subtle. I've tryed bundling with browserify with no success. I ended up using rollup:
But something is not right. When encrypting it shows this error message:
Is the bundling missing something? (also, couldn't a browser single file version be included in future releases?)
The text was updated successfully, but these errors were encountered: