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



On 9/30/2013 11:53 AM, Mike Davis wrote:
I just found these lists and what a goldmine!

Hello and welcome!

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.

What sort of data are you going to encrypt? This might influence the
algorithm you choose to use. As for decryption, that's not as obvious
as one might think. For instance, passwords on IBM i are not
decryptable. When you key one in on a 5250 display session, IBM i
encrypts what you keyed in and compares it to the stored (also
encrypted) value.

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.

Will the PCs be able to access the IBM i machine or will they be
standalone? If they are all connected to the i, you might want to look
at JT400 which can call RPG programs from the Java side.
http://jt400.sourceforge.net/
http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/rzahh/javadoc/overview-summary.html

Obviously I'll need a way to secure the encryption key ... I haven't
tackled that part yet.

Key management is often the hardest part of any encryption project.

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.

JT400 can read data areas natively, as well as stream files. You could
always write the encrypted data to an IFS stream file. Scott Klement
has a very nice tutorial on that: http://www.scottklement.com/rpg/ifs.html

So the problems I am trying to solve are ...

1. Looking for a simple example of using the crypto routines in RPG.

https://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=%2Fapis%2Fqc3WriteCusILERPG.htm

http://www.scottklement.com/rpg/cipher/

http://www.mcpressonline.com/rpg/simplify-encryption-with-the-use-of-rpg-reusable-procedures.html

2. Figure out the best crypto method that will work in both Java and RPG.

This thread is someone working through the problem:
http://archive.iprodeveloper.com/forums/aft/87211

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?

Use iconv() to convert between EBCDIC and UTF-8:
http://iprodeveloper.com/rpg-programming/how-convert-data-utf-8

--buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.