ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

encrypt decrypt revisited

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Re: encrypt decrypt revisited

    The program name must be same as pr & pi
    in this example program must be named "encrypt"

    if you called it "bill" then scan and replace "encrypt" with "bill"



    Code:
     d encrypt         pr
         d  inmode                        1a
         d  invalue                      30a
         d  inkey                        30a
         d  outvalue                     30a
    
         d encrypt         pi
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #17
      Re: encrypt decrypt revisited

      Hi all,

      We are on V5r2.
      I have downloaded and compiled and i received the error Definition not found for symbol 'Qc3DecryptData'.
      How can I make use of the tool on our version?

      Comment


      • #18
        Re: encrypt decrypt revisited

        greg...dont throw the pie at me but ..... Upgrade
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #19
          Re: encrypt decrypt revisited

          Originally posted by jamief View Post
          So has anyone tried to run this across their customer master file yet?

          what do you think?


          jamie
          Jamie, this is was a very helpful script for me too!Thanks.
          Yes, I did tried to run on customer master file but sadly some decrytion process isn't happening as expected.
          For e.g. file has part# of 17 char length,while I pass part# as 4022970120103734 it encrypts as ANWx*þ* <½a¾XÂ*with encryption key as @#$KEY. Again when I try to decrypt it accurately gives same part # as 4022970120103734.
          However when part# is changed to 372653890551001 it decrypts as FKWt*«**+ůØ[\-* with same ecrption key and now on triying to decrypt part # is incorrectly appearing as 3726538905510014.
          Note that we have addidtional '4' appearing at the end.

          Can you please assist me in investigating it?

          Comment


          • #20
            Re: encrypt decrypt revisited

            make sure the input field is cleared each time the first part# is 16 long where the second part is 15 long..the 4 belongs to the first part# .....
            All my answers were extracted from the "Big Dummy's Guide to the As400"
            and I take no responsibility for any of them.

            www.code400.com

            Comment


            • #21
              Re: encrypt decrypt revisited

              Hi,

              I have used the source you supplied in the above thread and it seems to work fine thx. However we have a requirement to use the RSA algorithym and I believe we need to supply the keys in PEM format.

              I'm a little lost as to how to amend the code you supplied on the thread and wondered if you'd be able to have a look and if possible let me know what I need to change ?

              Comment


              • #22
                Re: encrypt decrypt revisited

                Sorry david...you might be on your own with this one..
                Please post anything you come up with and maybe someone else here can be a help.

                welcome
                Jamie
                All my answers were extracted from the "Big Dummy's Guide to the As400"
                and I take no responsibility for any of them.

                www.code400.com

                Comment


                • #23
                  Re: encrypt decrypt revisited again

                  Hi,

                  I have tested the RC4 encryption program from jamief and it works both ways (encrypt/decrypt) on IBM I either when EBCDIC or ASCII is passed.

                  BUT !!! it dosn't return the correct/expected hexadecimal encryption neither if the input is EBCDIC or ASCII/UTF-8 !

                  PHP Code:
                  Key 'SECRET' hex in EBCDIC x'E2 C5 C3 D9 C5 E3'
                  Input 'Henrik' hex in EBCDIC x'C8 85 95 99 89 92'
                  Result hex x'55 63 D0 23 4F 53'


                  Key 'SECRET' hex in ASCII x'53 45 43 52 45 54'
                  Input 'Henrik' hex in ASCII x'48 65 6E 72 69 6B'
                  Result hex x'9E 26 13 5A 7A 90'


                  Expected Hex Resultx'D4 0B 02 0D 66 4B' from various web site converters
                  I have of course tried several combinations and even converting the result from EBCDIC to ASCII.

                  Has anyone any idears?

                  Comment

                  Working...
                  X