cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pbiembed5 Occasional Visitor
Occasional Visitor

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 6
dmarkham Frequent Visitor
Frequent Visitor

Re: Gateway public key size problem

We are also seeing the same problem

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

Thanks

dmarkham Frequent Visitor
Frequent Visitor

Re: Gateway public key size problem

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 Frequent Visitor
Frequent Visitor

Re: Gateway public key size problem

Any update on this problem?

PeterPetkov Frequent Visitor
Frequent Visitor

Re: Gateway public key size problem

Got the same problem last week while setting up a new gateway.

 

Found updated code example in https://github.com/microsoft/PowerBI-CSharp/tree/master/sdk/PowerBI.Api/Extensions/V2

dmarkham Frequent Visitor
Frequent Visitor

Re: Gateway public key size problem

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?

PeterPetkov Frequent Visitor
Frequent Visitor

Re: Gateway public key size problem

My problem is solved. But in addition to new AsymmetricKeyEncryptor code, i've updated the Microsoft.PowerBI.Api NuGet package to 2.14 and Enterprise Gateway is the latest 3000.27.30 (February 2020) release

 

P.S.

The link from my previous comment is not working. Code is moved one level up

https://github.com/microsoft/PowerBI-CSharp/tree/master/sdk/PowerBI.Api/Extensions/

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors