publicKey.encrypt is not a function
See original GitHub issueI got this error
privateKey.sign is not a function
in the below code:
var signature = crypt.signature(privateKey, text);
Also
publicKey.encrypt is not a function
in here:
var encrypted = crypt.encrypt(publicKey, text);
Does anyone know about this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Nodejs `crypto.publicEncrypt` would not take public key ...
The generated public key looks like this: ssh-rsa AAAAB3NzaC1yc2EAAA... When I try to use crypto in Node.js to encrypt a plain string,
Read more >Crypto | Node.js v19.3.0 Documentation
PKCS#1 and SEC1 can only be encrypted by specifying a cipher when the PEM format is used. For maximum compatibility, use PKCS#8 for...
Read more >crypto/rsa - Go Packages
Package rsa implements RSA encryption as specified in PKCS #1 and RFC 8017. ... to this function – the random data need not...
Read more >Public key encryption (article) - Khan Academy
It's a "one-way function ", which means it's incredibly difficult for a computer to reverse the operation and discover the original data. Even...
Read more >SubtleCrypto.encrypt() - Web APIs | MDN
However, it need not be secret (for example, it may be transmitted ... The RSA-OAEP public-key encryption system is specified in RFC 3447....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found the issue! it was my mistake that inside the Crypt.js I had changed the name of sign method to signature !! I’m so sorry for taking your time for such a bad mistake!
I got this:
It seems that, for a some reason, private key gets never casted into forge private key object. What’s your output for
console.log(typeof keys.privateKey)
? It would be nice to know what valueprivateKey
has just before the line that causes the error.