× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.