Link to CryptoJS Documentation:
You could certainly use CryptoJS within a p5.js script. However, we need to see an example of code that you are trying to get to work.
In your HTML file, try this:
- Link to the CryptoJS library.
- Link to the p5.js library.
- Link to your sketch script.
If you could provide us with an HTML file and a sketch to exemplify what you are trying to do, we can try to help. However, if you are trying to encrypt JavaScript code itself, and hope to have the browser execute it without making the code accessible to a visitor to the web page, that may be difficult or impractical. I don’t feel able to do that, but perhaps someone else can offer suggestions.