0

I have encrypted value and I tried to decrypt it using asp_regiis.exe.

<configuration>
<connectionStrings 
    configProtectionProvider="DataProtectionConfigurationProvider">
  <EncryptedData>
    <CipherData>
      <CipherValue>AQAAANCMnd8BFdERjHoAwE/Cl....fK39sbTH</CipherValue>
    </CipherData>
  </EncryptedData>
</connectionStrings>
</configuration>

When I run this command:

aspnet_regiis.exe -pdf "connectionStrings" "C:\Users\Test" 

I have this error:

Decrypting configuration section...

Failed to decrypt using provider 'DataProtectionConfigurationProvider'. Error message from the provider:

Data at the root level is invalid. Line 1, position 1.
Failed!

What seems wrong with this? I need to find the decrypted value. Please advise.

Termininja
  • 6,620
  • 12
  • 48
  • 49
Gilbert
  • 11
  • 6
  • how did you encrypt data ? because encryption could be at the computer level or at the user level – Thomas Jul 12 '16 at 06:44
  • Actually I don't know how was the data was encrypted. It was encrypted few years ago by the developer and we need to change it now since we change our database. – Gilbert Jul 12 '16 at 07:20
  • I just want to know how can I know the value of this encrypted data and how can I input/place the new encrypted value for our new database. – Gilbert Jul 12 '16 at 10:10
  • if it was encripted as the computer level, you can use this answer http://stackoverflow.com/questions/34194223/dpapi-password-encryption-in-c-sharp-and-saving-into-database-then-decrypting-it/34196810#34196810. Otherwise if the data has been encrypted at the user level, you need to decrypt the data using the same user account – Thomas Jul 12 '16 at 10:21
  • if you dont need to decrypt the data, you can see this article https://msdn.microsoft.com/en-us/library/ff647398.aspx – Thomas Jul 12 '16 at 10:22
  • Thanks @Thomas. I will try your first suggestion above. On the next comment, I already tried to encrypt the new database and the replaced the connString value with the new encrypted data. But I encountered this error when accessing the site. – Gilbert Jul 12 '16 at 10:54
  • Here is the error when I tried to access the site... Error Id :421a46fd-2690-4480-a6cb-0794f07f95e3 Error Type: five - ex.InnerException IsNot Nothing Error Message :An unhandled exception has occurred. – Gilbert Jul 12 '16 at 11:08
  • Error InnerException: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: The web server has been unable to contact the Federation Server. at System.Web.Security.SingleSignOn.WSPersistentState.GetPersistentInfo(TrustedRealm& trustedRealm, String& fsAccountName) at System.Web.Security.SingleSignOn.WebSsoAuthenticationModule.AuthenticateWithWSFederationPassive() at System.Web.Security.SingleSignOn.WebSsoAuthenticationModule.OnAuthenticateRequest(Object o, EventArgs args) - End of inner exception stack trace – Gilbert Jul 12 '16 at 11:08
  • @Thomas Sorry for that.. – Gilbert Jul 12 '16 at 11:10
  • The new encrypted value was place on this section: – Gilbert Jul 12 '16 at 11:10
  • The connstring value was called in the code behind through: Dim dtaRetriever As DataRetriever = New DataRetriever() connString = dtaRetriever.GetAppSettingKey("connString") – Gilbert Jul 12 '16 at 12:13
  • Anyone who can help me on this? – Gilbert Jul 14 '16 at 01:31

0 Answers0