But why my code is giving that error ?



On Thu, Sep 19, 2019 at 3:42 PM Birgitta Hauser <Hauser@xxxxxxxxxxxxxxx>
wrote:


What is encrypt a function? An RPG function from a service program or a
specific tool?
In either way it is not an SQL Function (at least not a SQL function that
is
included in Db2 for i)

For AES encryption you need the SQL Function Encrypt_AES
(
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/db2/rbafzscaencryp
taes.htm
<https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/db2/rbafzscaencryptaes.htm>
)

I did not check it, but encrypting a value with SQL, should look as
follows:
DCL-S Text VarChar(20);
DCL-S Encrypted VarChar(256);
DCL-S Password VarChar(15) inz('yourPassWord')

Text = 'Whatever Text'
Exec SQL Set :Encrypted = Encrypt_AES(Text, PassWord);


Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"
„Train people well enough so they can leave, treat them well enough so they
don't want to.“ (Richard Branson)


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
Rishi
Seth
Sent: Donnerstag, 19. September 2019 15:29
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Regarding Decryption of AES128 encrypted data in RPGLE and
query regarding CRC 32

Thanks but getting below error while trying to encrypt and may be same
error
could appear while decrption:-

Additional Message Information



Message ID . . . . . . : RNF0312 Severity . . . . . . . : 20

Message type . . . . . : Diagnostic



Message . . . . : A right parenthesis is expected but is not found.

Cause . . . . . : For every left parenthesis specified, there must be a

matching right parenthesis to end the subexpression, parameter list, or
list
of array indexes. A right parenthesis is assumed.

Recovery . . . : Specify a right parenthesis to match the corresponding

left parenthesis. Compile again.



*************** Beginning of data *************************************
/free
dt1 s 50 inz('abcde')
dt2 s 50
dk s 50 INZ('16-9d15-ec98bcc81ec4275
D -OIM1TS7LI')

t2 = encrypt(t1, k, 1);
****************** End of data ****************************************




On Tue, Sep 17, 2019 at 3:09 PM Raul Jager <raul@xxxxxxxxxx> wrote:

SQL has several encryption algorithms. You can use them to encrypt
data in memory, no need to write to disk.

On 9/17/19 7:33 AM, Rishi Seth wrote:
Hi,

Could someone please advise on followings:-

1) How to decrypt data using AES 128 Alogorithm using RPGLE Program?

2) How to write RPGLE Program which supports CRC32 algorithm and
generates
same data which CRC 32 algorithm generates.


Thanks

-- Este e-mail fue enviado desde el Mail Server del diario ABC Color --
-- Verificado por Anti-Virus Corporativo Symantec --
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link:
https://amazon.midrange.com

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


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.