IBM Rational Developer for i

 View Only
  • 1.  md5 in SQL or RPG on iSeries

    Posted Fri February 03, 2023 09:40 AM
    anyone know how to use MD5 encryption in RPGLE or SQL?
    all the examples on IBM do not work.
    thank you

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


  • 2.  RE: md5 in SQL or RPG on iSeries

    Posted Sun February 05, 2023 02:32 AM
    Hi Sandra,

    we do that with IceBreak. It is the only native ILE Web Server and Application Server on IBM i and brings a ton of additional features.
    Because there is a community Edition, which can be used by everyone for free, I would recommend you to take a look on it.
    If you want to download it, please contact me and I will give you a link to an actual version.

    Because IBM i uses EBCDIC Code, while all the others (beside the IBM Mainframe) use ASCII you need to translate the string you want to encrypt before you convert it.

    So this here won't work:
    a = md5(based64('Hello')); 
    while this one works:
    a = md5(xlate(based64(xlateStr('Hello':0:1208):0:1208); 

    Please be aware that md5 encryption is not safe. So only use it, where it is demanded for. If you want to encrypt something in a secure way, you should take a look here:
    https://www.ibm.com/docs/en/i/7.4?topic=category-cryptographic-services-apis


    ------------------------------
    Markus Litters
    ------------------------------



  • 3.  RE: md5 in SQL or RPG on iSeries

    Posted Sun February 05, 2023 10:07 AM
    thank you Marcus,

    I'll give your example a try.
    I did hear that MD5 was not safe but we are not in a position to choose the method at this point.
    I appreciate your help.
    Sandy





  • 4.  RE: md5 in SQL or RPG on iSeries

    Posted Mon February 13, 2023 02:37 AM

    Hi Sandra,

    I just saw that something went wrong... I sent you already the link as an email reply to this Thread but it is not listed. Maybe I made a mistake?!?

    Nevertheless here it is:

    https://www.system-method.com/download-icebreakce

    You can register for free by pressing on the Download Button.

    You get a Version which works for 30 days as the Enterprise Edition. After that it falls back to the community Edition.

    In the Enterprise Edition you will have all the possibilities, like using IceBreak as the fastest Webserver or Webservice Server on IBM i.

    You can create Microservices in RPG and host them via IceBreak and a lot more.

    If you have any question please tell me.

    Have fun with it and I would be happy to hear from you, if it works as intended.

    Kind regards

    Markus



    ------------------------------
    Markus A. Litters
    ------------------------------