There are several encrypt and decrypt functions in SQL that may be of
help. SQL works in both RPG and Java programs.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mike Davis
Sent: Monday, September 30, 2013 11:54 AM
To: rpg400-l@xxxxxxxxxxxx; java400-l@xxxxxxxxxxxx
Subject: Encryption with Java and RPG?
Hi All:
I just found these lists and what a goldmine!
I'm posting this question to the RPG group and Java group because it
relates to both (I think).
My boss handed me an interesting problem ... hoping to get some pointers
or guidance here.
What I need to do is encrypt some text on the iSeries (in an RPG
program), store the encrypted data in a text field (data area,
probably), and (obviously) be able to decrypt the data.
Here's the rub ... I also need to be able to decrypt the data from one
or more Java programs. The java programs may be running on the iSeries
or on a PC.
Obviously I'll need a way to secure the encryption key ... I haven't
tackled that part yet.
Third party products aren't an option, as this is only a periodic thing
(at least that's what my boss tells me, I have my doubts).
A google search found some chapter's in the "API's at Work" book by
Messrs Vining, Pence, and Hawkins... I've already put in a request to
purchase that book,
The way my boss wants this to work is we run a command with the new data
to be encrypted ... the encrypted data is stored in the data area and
displayed to the user (one of our ops people), they copy the encrypted
data and paste it into a text file that the java program can read and
decrypt. The encryption key will probably be hard coded
(somehow) in the RPG and Java programs.
So the problems I am trying to solve are ...
1. Looking for a simple example of using the crypto routines in RPG.
2. Figure out the best crypto method that will work in both Java and
RPG.
3. What format should I use when encrypting the data (I figure the
routines won't encrypt the same text in ASCII and EBCDIC the same).
Maybe Unicode?
OR ....
Is this really a fools errand ... and should I try to convince my boss
that we should do the encryption independently on both sides.
Thanks all! I appreciate all input.
Mike
(Mikey likes it! Hey Mikey!)
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.