I don’t believe the Javascript runtime provided by Apple includes cryptographic primitives and looking at docs.scriptable.app it doesn’t look like scriptable provides a separate API for that. A quick search showed Forge as the most reliable crypto library for JS which can be installed using NPM