error: ProfileVersion1 requires an EncryptionKey that is 32 bytes long

Mattheis, Dirk 0 Reputation points
2024-03-17T17:36:42.5566667+00:00

I have this json to commit a lob pkg:

{"fileEncryptionInfo": {"encryptionKey": "fea98d9079db2b08446d6163ca1cabb2","initializationVector": "22957e909d50f58f393333fd34cd1c70","mac": "4d3ce6bb050301cafd8f433e305640992832fcadf1d32d0138e7adb1412e8206","macKey": "d77b99406783d05f12ba1489da3340c2","profileIdentifier": "ProfileVersion1","fileDigest": "e6ca6fc13195b8e98b1a93ffdf08cd20f39b65afce48c287474653b8130f7cd9","fileDigestAlgorithm": "SHA256"}}

But I get this error:

ProfileVersion1 requires an EncryptionKey that is 32 bytes long. - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000

Why is graph not accepting my enryption key?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,274 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
5,201 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Crystal-MSFT 49,351 Reputation points Microsoft Vendor
    2024-03-18T02:11:13.84+00:00

    @Mattheis, Dirk, Thanks for posting in Q&A. From the error message, I find the error is caused that the EncryptionKey you provided is not 32 bytes long. Based on my researching, one byte is the range 00000000 - 11111111 in binary, or 0x00 - 0xFF in hex. As you can see, one byte is represented in hex as a 2 characters string. Therefore, a 32-byte hex string is 64 characters long.

    In the json, I notice the "encryptionKey" is only 32 characters. Please increase it to 64 characters to see if it works.

    Hope the above information can help.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Mattheis, Dirk 0 Reputation points
    2024-03-18T09:57:24.9366667+00:00

    Doesn't work with either, I tried strEncryptionKey=$(openssl rand -hex 16) and strEncryptionKey=$(openssl rand -hex 32), also tried strEncryptionKey=$(openssl rand -hex 16) | base64) and strEncryptionKey=$(openssl rand -hex 32 | base64). Also, when using x-graph and viewing the javascript logging, I see that the value is 44 bytes which seems to be 32 bytes in base64.


  3. Mattheis, Dirk 0 Reputation points
    2024-03-18T10:43:19.5433333+00:00

    looks like $(openssl rand 32 | base64) does work but now the upload fails to commit.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.