Forum Discussion

pbiembed5's avatar
pbiembed5
New Member
6 years ago

Gateway public key size problem

Hello,

 

Is something changed with the public key size on the enterprise gateway lately?


I've been using this key successfully to encrypt credentials and update DataSources bound on an already set up gateway.
However after updating the gateway suddenly the returned key is 2048 bit instead the old one which was 1024bit ?

 

(print scr. of the current vs old key)

http://prntscr.com/q8tja2

 

With this key size, the following documentation on the official powerbi docs 
https://docs.microsoft.com/en-us/power-bi/developer/encrypt-credentials

is not working since it is using the previous 1024 vit key version.

 

Any idea why this has been changed or possibly it is problem with my gateway ?

 

 

Thanks a lot.

Cheers

 

6 Replies

  • dmarkham's avatar
    dmarkham
    Frequent Visitor

    We are also seeing the same problem

    Were you able to find out more, or has there been an official response?

    Thanks

    • dmarkham's avatar
      dmarkham
      Frequent Visitor

      Incidently,

      If you fix the provided code to use an encrypted length based on the key size, Power BI gateway won't decrypt and throws the following error:

      DM.EnterpriseGateway Error: 0 : 2019-12-27T10:48:00.1390752Z DM.EnterpriseGateway a2650f49-396e-4e2c-b148-2cffef33b894 2880da58-6746-4578-83c6-40a997897f6a MGEC 00000000-0000-0000-0000-000000000000 d4c561e9-1c83-458a-84ed-1d5130e1dded d4c561e9-1c83-458a-84ed-1d5130e1dded 4B80A52E [DM.Pipeline.Common] Non-gateway exception encountered in activity scope: System.Security.Cryptography.CryptographicException: The parameter is incorrect.

      at System.Security.Cryptography.NCryptNative.DecryptData[T](SafeNCryptKeyHandle key, Byte[] data, T& paddingInfo, AsymmetricPaddingMode paddingMode, NCryptDecryptor`1 decryptor)
      at System.Security.Cryptography.NCryptNative.DecryptDataOaep(SafeNCryptKeyHandle key, Byte[] data, String hashAlgorithm)
      at System.Security.Cryptography.RSACng.Decrypt(Byte[] data, RSAEncryptionPadding padding)
      at Microsoft.PowerBI.DataMovement.CommonUtilities.Security.AsymmetricHigherKeyEncryptionHelper.Decrypt(String cipherText, String containerName)
      at Microsoft.PowerBI.DataMovement.Pipeline.GatewayCore.GatewayProcessor.EncryptCredentialsWithSymmetricKey(GatewaySerializationContext responseContext, Func`1 getPlainCredentials)
      at Microsoft.PowerBI.DataMovement.Pipeline.GatewayCore.GatewayProcessor.<>c__DisplayClass6_0.<<EncryptCredentialsWithTestDataSourceConnection>b__0>d.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Microsoft.PowerBI.DataMovement.Pipeline.GatewayPipelineTelemetry.PipelineTelemetryService.<ExecuteInActivity>d__7`1.MoveNext()

       

    • dmarkham's avatar
      dmarkham
      Frequent Visitor

      Not had time to fully qualify, but initial tests did not show this code making any difference
      The error went away, but additional errors occurred on the gateway with other operations as a result

       

      I've not had time to check into it exactly, but wondering did this fix the problem for you?