Hi @at7140,
You can start by creating your PB and putting into it your JS code that do the encrypting like this:

In the delivery, load the PB like this :

Select the PB created :

You should have someting like this:

You can now use your funtion as pleased il your HTML :

Result :

Br