Are you hosting the web pages on a server that you control? If so, you could hide a lot of the logic by using a web framework, such as Flask. See:
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.
You could put the p5.js and the CryptoJS libraries in the libraries folder. That libraries folder could be within the same folder as your sketch. Just let us know how you have configured the files when providing us with example code.
Is there a good CryptoJS discussion group? It seems that this may be more of a CryptoJS issue than a p5.js one. A CryptoJS discussion group might be a venue where you can find expertise for good advice regarding this topic. If you do post a query concerning this issue on such a forum, please provide us a link to the post. They may also benefit if you provide a link from that post back to this discussion.