Forum Discussion

RezaSh_129343's avatar
RezaSh_129343
Icon for Nimbostratus rankNimbostratus
Aug 14, 2013

Can I encrypt specific nodes within HTTP payload with iRules?

Hi, I have a requirement to encrypt some of the contents within an HTTP request body. Is this possible with iRules? If yes, how would it be done? Example:

 

Input to F5 LTM:

 

John

 

Output from F5 LTM:

 

123asdgdfg21354654dfgdf

 

Regards

 

3 Replies

  • You can use an encryption mechanism:

     

    AES:: commands

     

    CRYPTO:: commands

     

    And even hashing mechanisms:

     

    md5:: commands

     

    sha1 commands (also sha256, 384, and 512)

     

    But then it depends on where you're sending it and who needs to be able to decrypt it (or if it needs to be decrypted at all). If you're just encrypting it to the sender so that you can decrypt it when it's relayed back, the AES:: commands will work best. If you need interoperability with third parties, the CRYPTO:: commands are probably best (new in v11.1). If you don't need to decrypt at all, a hashing algorithm like md5 or sha will work.

     

  • Absolutely. You can use HTTP::collect, HTTP::payload, and a variety of string and regex commands to manipulate the content. If you need help with this, please post a sample of the payload data. Also, is this request or response data?