Thanks for the terminology clarification. Still getting used to M so please bear with me here. I'm using GT.M-amd64-Linux/V6.3-000A.
Just in the research I've done so far, I'm looking at something along the lines of the below, but I would love to see more advanced and complete snippets.
;--
; New, define variables
;--
N cryptKey,derivedKey,cipher,plainText
S cryptKey="Private Encryption Key"
S derivedKey=$$zderiveKey(cryptKey,1,1)
S plainText'"Hello, Crypto World!"
;--
; Encrypt plainText
;--
S cipher=$$zaesenc(plainText,derivedKey)
;--
; Display decrypted text
;--
W #
W !,"Encrypted: ",cipher
W !!,"Decrypted: ",$$zaesdec(cipher,derivedKey)
Q
I'll look into the Foreign subroutine interface. Anything like Haskell's FFI?