Programming Languages on Power

Power Programming Languages

IBM Power, including the AIX, IBM i, and Linux operating systems, support a wide range of programming languages, catering to both traditional enterprise applications and modern development needs.


#Power


#Servers
#Programminglanguages
 View Only
  • 1.  MD5 encryption

    Posted 02/03/23 09:51 AM
    anyone know how to encrypt data using MD5 encryption?
    IBM documentation examples do not work.

    ------------------------------
    Sandra Wellington
    ------------------------------

    #RPG


  • 2.  RE: MD5 encryption

    Posted 02/03/23 10:13 AM
    Hi Sandra,





  • 3.  RE: MD5 encryption

    Posted 02/03/23 10:15 AM

    There are many examples and discussions on the web. This one uses SQL capabilities:

    Create an MD5 Hash Using RPG and SQL

    Mcpressonline remove preview
    Create an MD5 Hash Using RPG and SQL
    When developing modern applications or enhancing legacy ones, an RPG or DB2 routine may need to apply an MD5 hash to application data. Fortunately, IBM i/OS offers a machine interface operation called CIPHER to make the task of implementing MD5 relatively simple.
    View this on Mcpressonline >


    Just google 'using md5 in rpg'



    ------------------------------
    Jon Paris
    ------------------------------



  • 4.  RE: MD5 encryption

    Posted 02/03/23 10:16 AM
    Hi Sandra,

    my reply by email seems messed up - so here again. 

    What API are you using? Qc3CalculateHash?

    I have done some programming using Qc3CalculateHash with SHA-512 hashes. 
    What problems to you have?
    Regards,
    Daniel


    ------------------------------
    Daniel Gross
    ------------------------------



  • 5.  RE: MD5 encryption

    Posted 02/03/23 10:20 AM
    thank you for replying, I'm mostly trying w/i sql using this statement:


    ------------------------------
    Sandra Wellington
    ------------------------------



  • 6.  RE: MD5 encryption

    Posted 02/03/23 10:41 AM
    Hi Sandra,

    which IBM i version/release are you using? AFAIK the HASH_MD5 function was introduced with 7.4.

    Daniel

    ------------------------------
    Daniel Gross
    ------------------------------



  • 7.  RE: MD5 encryption

    Posted 02/03/23 10:45 AM
    I'm actually not sure, I'll find out.
    thank you

    ------------------------------
    Sandra Wellington
    ------------------------------



  • 8.  RE: MD5 encryption

    Posted 02/03/23 10:41 AM
    I just found this sample code using the API Qc3CalculateHash, it looks pretty good, I'll try this out:
    https://www.mysamplecode.com/2011/05/rpgle-generate-sha-1-hash-use.html
    thank you
    Sandy

    ------------------------------
    Sandra Wellington
    ------------------------------