|
This worked fine for me too
**free
DCL-S Text Char(20) inz('My encryption data') ;
DCL-S Encrypted Char(50);
DCL-S PassWord VarChar(15) inz('MyPassword');
//----------------------------------------------------------------
Exec SQL set :Encrypted = Encrypt_AES(:Text, :Password);
Dsply SQLCODE;
Dsply Encrypted;
*inlr = *on;
I changed Encrypt_AES to Encrypt and that worked fine also.
Rishi, what are you getting for SQLCODE?
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: Monday, September 23, 2019 8:43 AM
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.
Hi even after changing it sqlrpgle type debug values for both encrypt
decrypt are coming as blanks
On Mon, Sep 23, 2019 at 12:57 PM Birgitta Hauser <Hauser@xxxxxxxxxxxxxxx>
wrote:
Did you change the source attribute to SQLRPGLE? I assume NOT!is
You get RNF errors which are RPG Errors, so the SQL Precompiler did
not run before.
The following example works for me
DCL-S Text Char(20) inz('My encryption data') ;
DCL-S Encrypted Char(50);
DCL-S PassWord VarChar(15) inz('MyPassword');
//----------------------------------------------------------------
Exec SQL set :Encrypted = Encrypt_AES(:Text, :Password);
Dsply SQLCODE;
Dsply Encrypted;
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: Montag, 23. September 2019 08:14
To: Midrange Systems Technical Discussion
<midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Regarding Decryption of AES128 encrypted data in RPGLE
and query regarding CRC 32
So similarly will it work för decryption?
On Fri, Sep 20, 2019, 18:10 Birgitta Hauser <Hauser@xxxxxxxxxxxxxxx>
wrote:
Dear Rishi,
do you read the answers you get?
I send you already yesterday the SQL Solution.
Here again the (embedded) SQL Source code (and don't forget to
change your source attribute to SQLRPGLE)
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: Freitag, 20. September 2019 15:11
To: Midrange Systems Technical Discussion
<midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Regarding Decryption of AES128 encrypted data in RPGLE
and query regarding CRC 32
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
function.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/rbafz
sc al e.htm Look up the various encrypt/decrypt functions there.
First of all, you are trying to use a SQL function, NOT a RPG
wrote:toSo 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
RPG.
wrote:previously.
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
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>
But i need to encrypt it that is why function is used.
On Friday, September 20, 2019, Sam_L <lennon_s_j@xxxxxxxxxxx>
inz('16-9d15-ec98bcc81ec4275OI
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
thisM1TI')
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.'
----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
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
--
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 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.