Uploaded image for project: 'OpenIDM'
  1. OpenIDM
  2. OPENIDM-10542

IDM decryption fails with AES 256-bit key

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: OpenIDM 5.0.0, OpenIDM 5.5.0, OpenIDM 6.0.0
    • Fix Version/s: 6.5.0
    • Component/s: Module - Cryptography
    • Environment:
      Amazon Linux AMI 2017.09.e, Oracle Java 8 (java version “1.8.0_92” with added JRE unlimited security policy files) and IDM 5.0
    • Target Version/s:
    • Verified Version/s:
    • Story Points:
      2
    • Sprint:
      OpenIDM Sprint 6.5-1, OpenIDM Sprint 6.5-2
    • Support Ticket IDs:

      Description

      Added a new AES-256 secret key to the JCEKS.

      Alias name: openidm-sym-256
      Creation date: 19-Mar-2018
      Entry type: SecretKeyEntry

      While openidm.encrypt works fine, e.g.,

      {
          “$crypto”: {
              “type”: “x-simple-encryption”,
              “value”: {
                  “cipher”: “AES/CBC/PKCS5Padding”,
                  “salt”: “j5VTelJherTh7OIXl0+odA==”,
                  “data”: “STOk44j+bh3Ah1VB6rdf7w==”,
                  “iv”: “FvRmPmVf1UhMGFM8gHVHLA==”,
                  “key”: “openidm-sym-256”,
                  “mac”: “rKB1rc6EU8dVWum8eLlaiw==”
              }
          }
      }
      

      openidm.decrypt() fails, throwing:

       Wrapped org.forgerock.json.JsonValueException: /: org.forgerock.json.crypto.JsonCryptoException: Decryption failed
      

      I tried a few AES_256 algorithms too with no padding (e.g., AES_256/CBC/NoPadding), but for none of the case could get a successful decryption. It is also weird that the encryption returns a data of 128-bit length only.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jason Jason Lemay
                Reporter:
                hahmadi hadi hahmadi
                QA Assignee:
                Alexander Dracka
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: