Do you intend to encrypt individual values and then use them in a message, or you have to encrypt the whole HTTP request body?
In either case, on the server you can access cryptography classes provided by the JDK.
You can place the encryption code in a new Java class and then invoke e.g. a static method, or you can invoke all the methods directly from Scheme.
For example:
(import ‘javax.crypto.Cipher ‘javax.crypto.spec.IvParameterSpec
‘nexj.core.util.RandUtil ‘nexj.core.util.Binary)
(define (encrypt-my-value s key)
(define cipher (javax.crypto.Cipher’getInstance “AES/CBC/PKCS5Padding”))
(cipher’init (javax.crypto.Cipher’ENCRYPT_MODE) key
(javax.crypto.spec.IvParameterSpec’new ((nexj.core.util.RandUtil’secureRandom)’generateSeed 16)))
(nexj.core.util.Binary’new (cipher’doFinal ((ifnull s “”)’getBytes “UTF-8”)))
)