I need to encrypt a string with the aes-256-cbc. My encryption is not matching what the other end needs which is a php endpoint. In the documentation there was definitely a statement that makes me think I did at least one thing wrong but I am not sure. Converting the aeskey to a hexidecimal format is what I think I may not understand. You see that I am taking each character in aeskey and building a string of the hex values for the character. Below is a bit of the code for the encryption. Once again I am missing something. Thanks all.
BASE.JSON = '{"customer_id":"1000"}'
ALG = "aes-256-cbc"
ACT=1
AESKEY= "31e92H1^FiERFgv7^nXg6DfC66rGpFb7"
GOSUB HEX.AES.KEY
IV.HEX = "31313131313131313131313131313131"
RESULT=""
RES = ENCRYPT(ALG,ACT,BASE.JSON,1,AESKEY,1,3,"",IV.HEX,RESULT,1)
DEBUG
STOP
HEX.AES.KEY:
NKEY=""
KEY.LEN = LEN(AESKEY)
FOR X = 1 TO KEY.LEN
KL = AESKEY[X,1]
HKL = OCONV(KL,'MX')
NKEY:=HKL
NEXT X
AESKEY = NKEY
RETURN
------------------------------
[Gary] [Rhodes]
[Universe Developer]
[NPW Companies]
[Hialeah] [FL] [USA]
------------------------------



