No need for the "/free" and "/end-free".
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Peter Dow
Sent: Tuesday, September 24, 2019 2:21 PM
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: Re: Regarding Decryption of AES128 encrypted data in RPGLE and query regarding CRC 32
Try this:
h option(*nodebugio: *srcstmt)
dcl-s enc varchar(50);
dcl-s psw char(31) ccsid(37)
inz('6-9d15-ec98bcc81ec4275OIM1TS7LI');
dcl-s text char(13) ccsid(37);
/free
text = 'whatever text';
exec SQL Set :enc = encrypt_AES(:text, :psw);
DSPLY SQLCODE;
DSPLY enc;
exec SQL Set :enc = decrypt_char(:enc, :psw);
DSPLY SQLCODE;
DSPLY enc;
eval *inlr=*on;
/end-free
When I compiled and ran this on v7r3 I got the following:
DSPLY 0
DSPLY <·( Nw¾/Ø&?Ú| ¾/Ø&?Ú| ä ³|Ò& ø (?1 ´ý
DSPLY 0
DSPLY whatever text
--
*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
petercdow@xxxxxxxxx <mailto:petercdow@xxxxxxxxx>
pdow@xxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxx>
----------------------------------------------------------------------
This message, and any attachments, is for the intended recipient(s) only, may contain information that is privileged, confidential and/or proprietary and subject to important terms and conditions available at
http://www.bankofamerica.com/emaildisclaimer. If you are not the intended recipient, please delete this message.
As an Amazon Associate we earn from qualifying purchases.