why does crypto not work? and how to achieve the same from crypto-js?

Dear All,

I have been trying to achieve the ability to generate a Key pair and signature Wix and especially corvid say that it utilises Node.js there is meant to be a functionality where you can do this I provide the link to the documentation: https://nodejs.org/api/crypto.html

however I have attempted to implement this and have come up against ‘crypto’ errors as it is not found. I am aware of the crypto-js and have this within the npm modules on my website however it doesn’t seem to allow the generation of a key pair or signature the same as crypto .

It would be really help full if someone could provide an answer to this. I look forward to your responses.

Best regards

Si

1 Like

In the first line of the documentation that you provided the link for, it is stated:

" It is possible for Node.js to be built without including support for the crypto module. In such cases, calling require(‘crypto’) will result in an error being thrown. "

You can add the NPM library to your project from the Package Manager :

Hi @yisrael-wix ,

Many thanks for your response,

So I would assume that there is no function to utilise ‘crypto’ as I said I have the crypto-js module installed, However the crypto-js doesn’t allow all the workings of crypto. Crypto-js doesn’t seem to enable generation of key pairs? or am I missing something?

Best wishes,

Si

@simonadams The crypto-js NPN library is not a Wix product. You’ll need to refer to the docs for crypto-js to see what functionality is available.

@yisrael-wix Thank you @yisrael-wix I have requested a new NPM module called Hybrid-crypto-js that enables the ability to create Key Pairs and cryptographic signatures. I hope that this will be available soon.

Many thanks for answering the question.

Best wishes

Si

@simonadams Hmm, didn’t know about this other NPM library. Thanks for pointing this out.

@yisrael-wix No worries, look forward to it being available.