Questions tagged [cryptographicexception]

41 questions
104
votes
7 answers

CryptographicException was unhandled: System cannot find the specified file

I am trying to embrace the mysteries of SSL communication and have found a great tutorial on this site. I was trying to test my own certificate. Using Visual Studio 2012, I simply added an existing file (my certificate in .pfx format) and then…
Storm
  • 3,062
  • 4
  • 23
  • 54
54
votes
14 answers

"Error occurred during a cryptographic operation" when decrypting Forms cookie

I've uploaded my website to a webhosting and this error came up; 'Error occurred during a cryptographic operation.'. I've done some research and it seems that the formauthenticated cookie is bound to the MachineKey (which differs when using…
Jeroen Vorsselman
  • 803
  • 1
  • 9
  • 19
12
votes
8 answers

TripleDES: Specified key is a known weak key for 'TripleDES' and cannot be used

I'm using the .NET 3.0 class System.Security.Cryptography.MACTripleDES class to generate a MAC value. Unfortunately, I am working with a hardware device that uses "1111111111111111" (as hex) as a single-length DES key. The…
David Chappelle
  • 1,243
  • 5
  • 13
  • 29
9
votes
3 answers

CryptographicException: Padding is invalid and cannot be removed and Validation of viewstate MAC failed

Monitoring my global exception logs this error seems to be impossible to remove no matter what I do, I thought I finally got rid of it but it's back again. You can see a strack trace of the error on a similar post here. Notes about the…
Chris Marisic
  • 32,487
  • 24
  • 164
  • 258
6
votes
3 answers

NetworkCredential error in ASP.NET

I am trying to access a webpage through ASP.NET using the NetworkCredential class. However I keep getting an exception with the following message System.Security.Cryptography.CryptographicException: The handle is invalid Below is my code on how I…
Seb
  • 3,414
  • 10
  • 73
  • 106
6
votes
2 answers

Using X509Certificate2 to get PrivateKey causes CryptographicException "Invalid provider type specified"

everyone, I am developing a web application that uses X509Certificate2 to get a private key from a certification file. Code snippet looks like following: public static RSACryptoServiceProvider GetSignProviderFromPfx() { var…
Alan Zhao
  • 61
  • 1
  • 3
4
votes
1 answer

CryptographicException in Classic ASP with MySQL TLS

I am facing this issue when I am trying to invoke a COM Visible c# class in classic ASP Page which tries to execute one MySQL query against database.(Here MySQL is on TLS). Here in my case one of the classic asp page, we create instance of SomeUser…
RockAndRoll
  • 2,247
  • 2
  • 16
  • 35
3
votes
4 answers

App.config connection string Protection error

I am running into an issue I had before; can't find my reference on how to solve it. Here is the issue. We encrypt the connection strings section in the app.config for our client application using code below: config =…
MikeScott8
  • 720
  • 2
  • 10
  • 17
3
votes
1 answer

CryptographicException in RSA.ImportParameters() - Bad Data in special 1024 keys

We have a C#/.Net 4.0 application which imports RSA Private Keys from a String in Base64 received in a WebService. This application works perfectly for RSA-Keys in 1024 bits, but doesn't with a special kind of rsa private keys (around 1% of…
user1084509
  • 1,832
  • 10
  • 33
  • 48
3
votes
1 answer

CryptographicException in WCF with PushSharp

I have a WCF service to send push notification to IOS device using APNS. I use the following code with using PushSharp. I got an error at the "RegisterAppleService" step. The error explanation is: "CryptographicException was unhandled by user…
3
votes
0 answers

CruiseControl.net SourceGear Vault CryptographicException: Keyset does not exist

I ran into this error while setting up CruiseControl.net with SourceGear Vault: CryptographicException: Keyset does not exist After seeing a LOT of solutions about setting access rights on the C:\Users\All Users\Microsoft\Crypto\RSA\MachineKeys…
2
votes
0 answers

ProtectedData.Unprotect method throws CryptographicException when different OS is installed on same machine

Our application is installed on a client location. The application uses ProtectedData.Protect method to protect a key on the client machine and saves the output to a file. Following is the code : ProtectedData.Protect(sampleHashKey, entropy,…
2
votes
0 answers

"The parameter is incorrect" exception when encrypting array using RSACng 512 + OaepSHA256

I'm having trouble using RSACng (512) with OaepSHA256 (C#, .NET Framework 4.6.1) - getting System.Security.Cryptography.CryptographicException: 'The parameter is incorrect.' while encoding (any) byte array: using…
snejk85
  • 21
  • 2
2
votes
1 answer

SignedXml.LoadXml() throws a CryptographicException

I have a connection to an external WebService which was running flawless for ages until medio may 2018. Suddenly I started getting a CryptographicException with the message "Malformed XML Signature". My investigation tells me the following: The…
itfar
  • 23
  • 3
2
votes
1 answer

Impersonating to X509Store.Add to StoreName.Root - The Request Is Not Supported

I cannot find anything related to the error that I am encountering. The problem is that I am encountering a CryptographicException on store.Add below: "The request is not supported." The MSDN Documentation is not very helpful, it states that: The…
1
2 3