Welcome to MSDN Blogs Sign in | Join | Help

Decrypt my World

Cryptography, Security, Debugging and more!

News

  • Any of my posts is supported under any Microsoft standard support program or service. They are provided "AS IS" without warranty of any kind, and confer no rights.

Where are my readers?

Locations of visitors to this page

Favorite Posts

Browse by Tags

All Tags » System.Security   (RSS)
Access Violation exception when loading a certificate in .NET (Windows Server 2003)
Hi all You may get an Access Violation exception when loading a certificate into a X509Certificate2 object, only after installing KB 938397 hotfix ( crypt32.dll v5.131.3790.4095 ) at Applications that use the Cryptography API cannot validate an X.509 Read More...
Working with CNG in .NET 3.5
Hi all, Do you want to work with CNG and .NET 3.5 and don't want to P/Invoke into CryptoAPI & CNG API ? Check out Security.Cryptography.dll library at CLR Security : " Security.Cryptography.dll provides a new set of algorithm implementations to augment Read More...
CryptographicException: The data to be decrypted exceeds the maximum for this modulus of 0 bytes
Hi all, Some time ago a customer of mine was getting the following CryptographicException when calling EncryptedXml.DecryptDocument method to decrypt an XmlDocument in their .NET app: [System.Security.Cryptography.CryptographicException] = {" The data Read More...
X509Certificate creates temporary files which are never deleted
Hi all, When creating an X509Certificate object in your .NET application (" X509Certificate cert = new X509Certificate(certBytes); ") you may see that two 0kb files are created in the Temp folder of your Windows Server 2003 , and are never deleted . After Read More...
Default Provider Type for CspParameters has changed
Hi all, Before .NET Framework 3.5 SP1 , the default provider type for CspParameters was PROV_RSA_FULL (1) . Now it's PROV_RSA_AES (24) for all operating systems which support Microsoft Enhanced RSA and AES Cryptographic Provider (WinXP and higher). So Read More...
How to view a certificate programatically (C#)
Hi all, The following C# sample shows a dialog to view a certificate and its properties . This is the same dialog that appears when we double-click on the cert file in Explorer. I'll use CryptUIDlgViewCertificate API and its CRYPTUI_VIEWCERTIFICATE_STRUCT Read More...
CRL gets cached after we do an Online verification with X509Chain
Hi all, When we use X509Chain class to verify if our certificate is not revoked, we may experience the following behavior: 1) We do an online verification ( X509Chain.ChainPolicy.RevocationMode set to X509RevocationMode.Online ) on a valid certificate Read More...
RSACryptoServiceProvider fails if we delete a user from the machine
Hi all, The other day a customer of mine had an interesting issue: a specific user runs their application for the first time without problem on a machine. Any other user can run the app without problems on the same machine, too. If that specific user Read More...
How to generate key pairs, encrypt and decrypt data with .NET (C#)
Hi all, The other day a colleague of mine asked me if I had a .NET version of the C++ sample in How to generate key pairs, encrypt and decrypt data with CryptoAPI post. C++ sample calls CryptoAPI directly (and you know we can do the same thing in .NET Read More...
CryptographicException: Unable to open the access token of the current thread
Hi all, When working with RSACryptoServiceProvider , we may get an exception like the following: System.Security.Cryptography. CryptographicException : Unable to open the access token of the current thread at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 Read More...
Threading issues with RSACryptoServiceProvider
Hi all, When using RSACryptoServiceProvider in i.e. ASP.NET you may get the following exception under a heavy load scenario: "System.Security.Cryptography.CryptographicException: CryptoAPI cryptographic service provider (CSP) for this implementation could Read More...
How to Sign and Verify the signature with .NET and a certificate (C#)
Hi all, Today I'm posting a sample which shows how to sign a text with a certificate in my Personal store (this cert will have public and private key associated to it) and how to verify that signature with a .cer file (for i.e. WinForms) applications Read More...
Who has access to a folder? (C#)
Hi all, welcome back, The following .NET 2.0 sample shows how to get security info from a folder to find out the permissions for users/groups on it: using System; using System.IO; using System.Security.AccessControl; using System.Security.Principal; namespace Read More...
How to sign an XML and verify the signature with .NET (VB.NET)
Hi all, Today I'm posting a sample which signs an XML with or without a certificate (PFX file) and verifies the signature, all that with .NET and its SignedXml class. I won't include in the sample the code that VS designer includes when I add the textboxes Read More...
XmlDsigC14NTransform normalization behavior depends on input type
Hi, welcome back, When using System.Security.Cryptography.Xml.XmlDsigC14NTransform , depending on the input type ( XmlDsigC14NTransform.InputTypes ) being passed to its LoadInput method, the result of its GetOutput method could be different: - If we pass Read More...
More Posts Next page »
Page view tracker