× 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.



RTFM.  IBM i Db2 for i SQl reference.

Chapter 4 Build-in functions

Scalar functions

Encript...  Various algorithms.

In RPG use:  EXEC SQL set :encripted = Encript(:data, :key, :hint);

On 9/20/19 9:11 AM, Rishi Seth wrote:
c/exec sql
c+ Declare c1 scroll cursor for
c+ select encrypt ('abcde','k1',1)
c+ FROM lib1/FL1
C/END-EXEC

Message ID . . . . . . : SQL0104 Severity . . . . . . . : 30

Message type . . . . . : Diagnostic



Message . . . . : Token ,1 was not valid. Valid tokens: ) ,.

Cause . . . . . : A syntax error was detected at token ,1. Token ,1 is
not
a valid token. A partial list of valid tokens is ) ,. This list assumes

that the statement is correct up to the token. The error may be earlier
in
the statement, but the syntax of the statement appears to be valid up to

this point.

Recovery . . . : Do one or more of the following and try the request
again:
-- Verify the SQL statement in the area of the token ,1. Correct the

statement. The error could be a missing comma or quotation mark, it
could
be a misspelled word, or it could be related to the order of clauses.

-- If the error token is <END-OF-STATEMENT>, correct the SQL statement

because it does not end with a valid clause.




On Fri, Sep 20, 2019 at 1:35 PM Rob Berendt <rob@xxxxxxxxx> wrote:

Let me find you a more applicable link:
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/db2/rbafzscale.htm
Look up the various encrypt/decrypt functions there.

First of all, you are trying to use a SQL function, NOT a RPG function.
So you have to use "imbedded sql".
If you know nothing about imbedded SQL in RPG you are probably better off
asking on the RPG list. They should be able to give you a couple of RTFM
links.

There is probably a way to do the encrypt/decrypt outside of RPG. One
method which comes to mind is to build an index or view over the file which
does the encrypting/decrypting for you before returning it to RPG.

Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com


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

CAUTION: This email originated from outside of the organization. Do not
click links or open attachments unless you recognize the sender and know
the content is safe.


I äm trying to use it as it's advised on below link but so far have been
unable to encrypt key in below program due to error mentioned previously.


https://www.ibm.com/support/knowledgecenter/en/SSULQD_7.1.0/com.ibm.nz.sqltk.doc/r_sqlext_encrypt_decrypt.html

Thanks.


On Friday, September 20, 2019, Rishi Seth <rishiseth99@xxxxxxxxx> wrote:

But i need to encrypt it that is why function is used.

On Friday, September 20, 2019, Sam_L <lennon_s_j@xxxxxxxxxxx> wrote:

This compiles except for the error "The name or indicator ENCRYPT is
not defined. "

dt1 s 50 inz('abcde')
dt2 s 50
dk s 50 inz('16-9d15-ec98bcc81ec4275OI
M1TI')
d************* I')
C EVAL T2= ENCRYPT(t1:k:1)

C T2 DSPLY
C EVAL *INLR=*ON

Sam


On 9/19/2019 3:19 PM, Rishi Seth wrote:

Hi,

It's RPGLE program now after putting colons it's giving error of
'**RNF7503
30 1 Expression contains an operand that is not defined.' this
error
is at below code's line no. 6*

--
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


-- Este e-mail fue enviado desde el Mail Server del diario ABC Color -- -- Verificado por Anti-Virus Corporativo Symantec --

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.