DataPower

 View Only
  • 1.  PGP Encryption

    Posted Wed February 21, 2024 08:28 AM

    Hi,

    Is it possible to make a PGP encryption and decryption for JSON payload on DataPower ? If yes, what are the steps that must be followed ?



    ------------------------------
    ahmed eldeeb
    ------------------------------


  • 2.  RE: PGP Encryption

    Posted Fri February 23, 2024 08:30 AM

    Hi,
    there is no builtin support for PGP in DataPower.

    You can search a CommonJS 1.0 PGP nodejs implementation and install that on DataPower.
    DataPower GatewaScript supports CommonJS 1.0:
    https://www.ibm.com/docs/en/datapower-gateway/10.0.1?topic=gateway-programming-model-gatewayscript

    I once installed AES encryption for GatewayScript and blogged about that:
    https://stamm-wilbrandt.de/en/blog/GatewayScript%20%20Modules%20%20AES.html



    ------------------------------
    Hermann Stamm-Wilbrandt
    Compiler Level 3 support, IBM DataPower Gateways
    IBM
    Boeblingen Germany
    ------------------------------



  • 3.  RE: PGP Encryption

    Posted Fri February 23, 2024 01:27 PM

    Hi,

    Thank you for your reply.

    I tried to make the encryption using the function of XSLT.

    These are the steps of PGP encryption:
    1- Generate Session key for one time use.
    2- Encrypt the message using This Session key.
    3- Encrypt the Session key by using recipient's public key.
    4- Send the encrypted message and encrypted session key in one packet to recipient.

    The final encrypted message I need to arrive will be like this:
     "hIwDciGgYp/PIncBA/9y8TrDLh6VkUdlDSVt1ffJ9BxHFSb2Sw7w2viuFvUmikucrAp5/BiNxItArr17zgYq6OpiKJYNGL/f3hZVy7ciWU7EvlNK3oEvnlC8b/1ypsLVU7v0En1WNpvPw5SBeuYCuWak5/RkyssuZ4oa0IctI6BsXbPFzDbjEgGKX8khAdLBRQFN04JIC1lLeZMSHKz2vn5It67euSgdwW/c/ongVDFJLu81Thq+KbVTlXUEK/ia2zYhnduJHXt/45OjuDyNS8NaaqqO6nEJ/49fDCd7oTjq5X7qcBowy/k604joSJ773aoqD6oxAvw57KeUv5kMpFZ3pGE1SWfu37c0FQxk1oXV/d223RNwYjiaPE4PYolYfEOUb3g4ELo5Wlrvwp76EM/4FuDfe1mBWIox4SYBFqw60e9lW+a2/BME7zsByR7zpGLBZRMXJSwg81C6CO1FTKKl/VMBwA5xi46uWcmAvdRMiXzOcZsQGQS/cfsX/bpRVBl1Ev8tU1p1EtJ0d6Yi2ewY0U0MEBIOeuJKL6rfJHKTpWgzJxeKN7sNQG9k4tyHrMhkz/0Yb3sHbL+CE5/k28nGzCosZD8+qT8PvcS6TJgrWQcX/YEBmx9ua/7Ncd9wpAalDeXPXfwS8Md2dY0KdqxAIQyVkZSRqPLaTz47WWI659BX0mGDwFE+QSuef6x5D4VazjIFaXGAFdUOUEpohLv3eSstXsZ5GP9V0cwFNXkilhoPJO6alMIVjIFxp/vBKIbypVCcreubUFroSo6DG5pklCd2+SdJkQ6GHkOKMfaL9xlh8Iu9fjyv+taD4M4AcjeVR3zqTC9Lq4i1b/OGg6dezY1kCsqLW2pljJRhgtiOORDNBAg\u003d".

    What I did: 
    1- I generated the session key by using XSLT function -> dp:generate-key .
    2- I encrypted the message by using this session key by using XSLT function -> dp:encrypt-data.
    3- I encrypted the session key by using XSLT function -> dp:encrypt-key.
     
    Now I need to send both encrypted session key and encrypted message in one packet or one message like above encrypted final message.


     



    ------------------------------
    ahmed eldeeb
    ------------------------------



  • 4.  RE: PGP Encryption

    Posted Mon February 26, 2024 02:41 AM
    Edited by Hermann Stamm-Wilbrandt Mon February 26, 2024 02:41 AM

    I cannot help more on this, but stating that XSLT encryption functions are for XML encryption and likely do not encrypt the way you need.
    Finally you need to combine the binary data anyway, which can most easily be done with GatewayScript.
    So best to search for a CommonJS 1.0 implementation of full PGP.



    ------------------------------
    Hermann Stamm-Wilbrandt
    Compiler Level 3 support, IBM DataPower Gateways
    IBM
    Boeblingen Germany
    ------------------------------



  • 5.  RE: PGP Encryption

    Posted Tue May 07, 2024 12:49 AM

    You can refer this medium article,

    https://medium.com/@mr.yadav235/securing-data-transmissions-implementing-openpgp-encryption-in-ibm-api-connect-and-datapower-6e30ab08ce0d



    ------------------------------
    Jayprakash Yadav
    ------------------------------