Way to encrypt text using a PGP key?

Does anyone know of a working way to script encrypting text using a PGP public key? I’ve primarily tried loading pgp js libraries with Scriptable, but it seems that the files are too long/complex (?) for Scriptable to properly parse (it throws errors that I don’t get on Desktop).