Announcement

Collapse
No announcement yet.

Qc3EncryptData for AES-GCM?

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

  • Qc3EncryptData for AES-GCM?

    After working on a S38/AS400/i5 for 30 years I have finally hit a problem I cannot find an answer for....Also excuse my naivety on security algorithm's, there is a first time for everyone


    Using the Qc3EncyptData API I have hit a problem with trying to configure the processing to handle the AES-GCM encryption.

    AES can be accessed using the Block Cipher Algorithm of "22" but when I come to set the Mode there is no "GCM" for selection (V7R4 manual).

    It looks like AES-GCM has been around for a few years so does Qc3EncyptData not support this encryption format or am I missing something?

    Did have a look at V7R5 and cannot find anything there either.

    Any suggestions on how to access AES-GCM from within an RPG program is the API does not support the function?

    Thanks

    Alex

  • #2
    Hmmm... I thought GCM was for authentication. Maybe you can use Qc3EncryptWithMAC?

    Comment


    • #3
      Thanks Scott, that looks like it will work.

      The setting missing I was looking for was "GCM" in the MODE setting.

      Alex

      Comment


      • #4
        Hi,

        I keep getting the following error on Qc3EncryptWithMAC
        CPF9DE2 MAC (message authentication code) length not valid
        I have the setting set to:

        MAC Length - 16
        Clear data length - 24
        Associated data length - 2
        Length of area provided for encrypted data - 40

        It does not seem to matter what I change I keep getting the same error.

        Any suggestions, I can post the code if that would help?

        Many thanks

        Alex

        Comment


        • #5
          Not to worry got the issue sorted...had the length of the Reserved field on ALGD0210 defined as 1A instead of 3A

          Comment

          Working...
          X