Sign in
Decrypt my World
Cryptography, Security, Debugging and more!
MSDN Blogs
>
Decrypt my World
Search
Options
About
RSS for posts
Atom
RSS for comments
OK
Disclaimer, Maps & Favorite Posts
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?
Favorite Posts
Do you need help right now?
CryptoAPI Tracer script
MANAGED DEBUGGING with WINDBG. Introduction and Index
Tags
ADSI
CAPICOM
CertEnroll
CNG
CryptAcquireContext
CryptoAPI
Debugger scripts
Debugging
NT Services
P/Invoke
PowerShell
RSACryptoServiceProvider
SCard API
Smart Card
System.DirectoryServices
System.Security
VBScript
WinDbg
Windows 7
Windows SDK
Windows Server 2003
Windows Server 2008
Windows Vista
Windows XP
WMI
Archive
Archives
July 2012
(1)
May 2012
(1)
April 2012
(6)
March 2012
(2)
January 2012
(1)
November 2011
(12)
September 2011
(5)
June 2011
(1)
May 2011
(2)
April 2011
(1)
March 2011
(3)
February 2011
(6)
January 2011
(2)
December 2010
(5)
October 2010
(8)
September 2010
(1)
August 2010
(8)
July 2010
(3)
June 2010
(2)
May 2010
(4)
April 2010
(3)
March 2010
(4)
February 2010
(2)
January 2010
(5)
December 2009
(6)
November 2009
(2)
October 2009
(3)
September 2009
(5)
August 2009
(13)
July 2009
(8)
June 2009
(2)
May 2009
(7)
April 2009
(3)
March 2009
(2)
February 2009
(3)
January 2009
(3)
December 2008
(3)
November 2008
(2)
October 2008
(4)
September 2008
(4)
August 2008
(3)
July 2008
(3)
June 2008
(7)
May 2008
(6)
April 2008
(7)
March 2008
(10)
February 2008
(3)
January 2008
(4)
December 2007
(6)
November 2007
(4)
October 2007
(4)
Share this blog with others!!!
My Twitter (http://twitter.com/alejacma)
RSS
http://twitter.com/statuses/user_timeline/174391821.rss
Posts
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
Decrypt my World
How to create a certificate request with CertEnroll and .NET (C#)
Posted
over 5 years ago
by
Alejandro Campos Magencio
87
Comments
Hi all, The following C# sample shows how to use CertEnroll COM component to create a certificate request , send the request to the CA , get the response from the CA , and install the new certificate in the machine: (Note that this sample is a WinForms...
Decrypt my World
How to create a certificate request with CertEnroll (JavaScript)
Posted
over 4 years ago
by
Alejandro Campos Magencio
53
Comments
Hi all, The following Javascript sample shows how to use CertEnroll COM component to create a certificate request: <html> <head> <title>Certificate Request test</title> </head> <body> <object id=" objCertEnrollClassFactory...
Decrypt my World
How to get Antivirus information with WMI (VBScript)
Posted
over 5 years ago
by
Alejandro Campos Magencio
34
Comments
Hi all, welcome back, As we read in Windows Security Center – Managing the State of Security , the vast majority of antivirus Independent Software Vendors (ISVs) support WMI integration. Windows Security Center uses it to detect antivirus and firewall...
Decrypt my World
Controls won't get resized once the nesting hierarchy of windows exceeds a certain depth (x64)
Posted
over 4 years ago
by
Alejandro Campos Magencio
33
Comments
Hi all, welcome back, I've been working on an issue where WM_SIZE events are not properly generated once the nesting hierarchy of windows exceeds a certain depth. This issue only occurs on current x64 Windows : like XP, Server 2008 or the latest Windows...
Decrypt my World
How to get the logged on user with WMI (VBScript)
Posted
over 5 years ago
by
Alejandro Campos Magencio
20
Comments
Hi all, welcome back, From time to time I get to do some scripting, play with LDAP/ADSI, WMI, etc. I'll begin posting some VBScript samples I have which may be useful for you too. Today we'll see a way to get the user who has logged on a given machine...
Decrypt my World
How to get a list of all users in an OU (VBScript)
Posted
over 5 years ago
by
Alejandro Campos Magencio
18
Comments
Hi all, welcome back, Today I'll post a very straight forward sample which gets a list of all users in an Organizational Unit ( OU ) in Active Directory ( AD ) using VBScript : ' Get OU ' strOU = "OU=Users,DC=domain,DC=com" ' Create connection...
Decrypt my World
How to Sign and Verify the signature with .NET and a certificate (C#)
Posted
over 5 years ago
by
Alejandro Campos Magencio
17
Comments
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...
Decrypt my World
How to import a certificate without user interaction (C++ & C#)
Posted
over 5 years ago
by
Alejandro Campos Magencio
17
Comments
Hi, welcome back, Today I'm posting a CryptoAPI sample which uses CryptUIWizImport to import a certificate without any user interaction: <SAMPLE Language="C++"> CRYPTUI_WIZ_IMPORT_SRC_INFO importSrc; memset(&importSrc, 0, sizeof(CRYPTUI_WIZ_IMPORT_SRC_INFO...
Decrypt my World
RSACryptoServiceProvider fails when used with ASP.NET
Posted
over 6 years ago
by
Alejandro Campos Magencio
15
Comments
Hi, welcome back, I will talk today about a very common issue we face when we try to use .NET's RSACryptoServiceProvider class in ASP.NET . When we try to create a new RSACryptoServiceProvider object in this scenario, we may get the following exception...
Decrypt my World
How to get information from a CRL (.NET)
Posted
over 4 years ago
by
Alejandro Campos Magencio
15
Comments
Hi all, The following C# sample uses CryptoAPI to read the info of a CRL ( Certificate Revocation List ) stored in a file: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using...
Decrypt my World
SHA-2 support on Windows XP
Posted
over 4 years ago
by
Alejandro Campos Magencio
14
Comments
Hi all, If you try to use any SHA-2 algorithm ( SHA-256, SHA-384 and SHA-512 ) on Windows XP , you may get the following error when using i.e. CryptCreateHash : NTE_BAD_ALGID or -2146893816 or 0x80090008 or "Invalid algorithm specified" . Same algorithms...
Decrypt my World
CAPICOM support on Windows Server 2008
Posted
over 5 years ago
by
Alejandro Campos Magencio
12
Comments
Hi all, welcome back, If you remember all the confusion there was regarding CAPICOM support on Vista , now everything seems much clearer on Windows Server 2008. Our documentation team has done its homework, as we can see in CAPICOM Reference : ...
Decrypt my World
How to change Registry Permissions with RegIni.exe (VBScript)
Posted
over 5 years ago
by
Alejandro Campos Magencio
11
Comments
Hi all, welcome back, Today I'll show how we can set the following permissions on a registry key with RegIni.exe and a VBScript : - Creator Owner Full Control - Users Full Control - Power Users Full Control - Administrators Full Control - System...
Decrypt my World
How to get assembly version without loading it
Posted
over 5 years ago
by
Alejandro Campos Magencio
11
Comments
Hi all, The other day I was trying to add a simple autoupdate functionality to a little tool I developed, and I needed to check the version of current assembly against the udpated one. If current assembly was older than the updated one, I needed to...
Decrypt my World
How to use DHeapMon.exe to troubleshoot Desktop Heap issues
Posted
over 5 years ago
by
Alejandro Campos Magencio
10
Comments
Hi all, The other day I had to troubleshoot an issue with a process that a specific Windows service was trying to launch without success. We could see with a debugger (i.e. WinDbg) that the new process was actually being created but it exited before...
Decrypt my World
Win32_Process.Create fails if user profile is not loaded
Posted
over 5 years ago
by
Alejandro Campos Magencio
10
Comments
Hi all, welcome back, The other day I worked on an issue which happened when using WMI method Win32_Process.Create to spawn a process from an ASP.NET application. This method was returning an UNKNOWN FAILURE (8) and the new process wasn't created....
Decrypt my World
P/Invoking CryptoAPI in .NET (C# version)
Posted
over 6 years ago
by
Alejandro Campos Magencio
10
Comments
Hi, welcome back, Sometimes we need to call CryptoAPI from .NET because classes in System.Security.Cryptography namespace have their limitations. For instance, we can't create a temporary key container with RSACryptoServiceProvider, but we can do it...
Decrypt my World
CAPICOM support on Windows Vista
Posted
over 6 years ago
by
Alejandro Campos Magencio
10
Comments
I know there has been a lot of confusion about this, because some articles on the web (i.e. MSDN) say CAPICOM is not supported on Vista , while others say it is. I have good news for you people, especially for those who want to do cryptographic operations...
Decrypt my World
How to view a certificate programatically (C#)
Posted
over 4 years ago
by
Alejandro Campos Magencio
10
Comments
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...
Decrypt my World
How to call CreateProcessWithLogonW & CreateProcessAsUser in .NET
Posted
over 6 years ago
by
Alejandro Campos Magencio
9
Comments
Hi, welcome back, Sometimes .NET 's System.Diagnostics.Process class and its Start method are not enough for our purposes and we need to call Win32 API directly from .NET ( P/Invoke mechanism) to be able to create a process the way we need. Here you...
Decrypt my World
How to sign and verify with CryptoAPI and a user certificate
Posted
over 5 years ago
by
Alejandro Campos Magencio
8
Comments
Hi, welcome back, Today I will show how to sign data and verify that signature using CryptoAPI and a certificate from our Personal store. The comments in the code should help to understand it. Remember that this is just a sample, and some more cleanup...
Decrypt my World
How to sign EXE files with an Authenticode certificate (part 2)
Posted
over 5 years ago
by
Alejandro Campos Magencio
8
Comments
Hi all, welcome back, The other day a customer of mine was having an issue with SignTool.exe when signing an EXE file. The EXE file was getting corrupted /unusable after signing it. When troubleshooting this issue, I had the chance to play a bit...
Decrypt my World
Do you need help right now?
Posted
over 4 years ago
by
Alejandro Campos Magencio
8
Comments
Hi all, I've been quite busy lately and didn't find any free time to post anything or answer all the questions I get on my posts. Really sorry about that. If you have any issue or question on anything you may find in my blog and you don't get an...
Decrypt my World
How to call CryptMsg API in streaming mode (C#)
Posted
over 3 years ago
by
Alejandro Campos Magencio
7
Comments
Hi all, The other day I posted an issue when signing large data with SignedCms in .NET (at least up to version 3.5 SP1): "ASN1 value too large" error when calling SignedCms.ComputeSignature . In that post, I mentioned the following to work around the...
Decrypt my World
How to generate key pairs, encrypt and decrypt data with .NET (C#)
Posted
over 5 years ago
by
Alejandro Campos Magencio
7
Comments
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 ...
Page 1 of 9 (215 items)
1
2
3
4
5
»
Translate This Page
Translate this page
Powered by
Microsoft® Translator