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 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 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 read a registry key and its values (VBScript)
Posted
over 5 years ago
by
Alejandro Campos Magencio
7
Comments
Hi all, welcome back, Today I'll share with you a couple of VBScript samples I developed the other day. They use WMI and its StdRegProv class to read the Windows registry . This sample will take a registry key and show its subkeys and the values...
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 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
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 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
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
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
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 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 ...
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
How to use Windbg to debug a dump of a 32bit .NET app running on a x64 machine
Posted
over 5 years ago
by
Alejandro Campos Magencio
7
Comments
Hi all, Imagine we are running a 32bit .NET app in a x64 machine . This app is failing so we have taken a memory dump of the app when a specific CLR exception gets raised. We open the dump with our 64bit version of Windbg ( Windbg x64 ), and we...
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
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
CAPICOM support on Windows 7
Posted
over 4 years ago
by
Alejandro Campos Magencio
5
Comments
Hi all, CAPICOM has finally been deprecated , and it won't be supported on Windows 7 . This link is up to date and proposes alternatives to CAPICOM classes by using .NET classes and CryptoAPI : Alternatives to Using CAPICOM . The following article...
Decrypt my World
Key Containers: Basics
Posted
over 6 years ago
by
Alejandro Campos Magencio
7
Comments
Hi, welcome back, Let's talk today a bit about Key Containers in CryptoAPI . Key containers can be created in user's profile or machine's. User-level key containers can only be used by the user in which profile they've been created, and machine...
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
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
RSACryptoServiceProvider.Encrypt returns "Key not valid for use in specified state" error
Posted
over 5 years ago
by
Alejandro Campos Magencio
2
Comments
Hi all, When executing RSACryptoServiceProvider.Encrypt method (see How to generate key pairs, encrypt and decrypt data with .NET (C#) for an example), you may get a System.Security.Cryptography.CryptographicException . According to MSDN , this is...
Decrypt my World
MANAGED DEBUGGING with WINDBG. Breaking on an Exception. Part 1
Posted
over 4 years ago
by
Alejandro Campos Magencio
2
Comments
Hi all, This post is a continuation of MANAGED DEBUGGING with WINDBG. Managed Heap. Part 5 . BREAKING ON AN EXCEPTION. Part 1 We can only break on exceptions when doing live debugging, but many of the commands explained here can be...
Decrypt my World
How to sign EXE files with an Authenticode certificate (VB.NET)
Posted
over 5 years ago
by
Alejandro Campos Magencio
3
Comments
Hi, welcome back, Sorry it took me so long to write a new post. I'm visiting my colleagues at Milano, and I'm horribly busy these days. For Windows platforms, below are the only supported methods we can use to digitally sign Authenticode executables...
Decrypt my World
MANAGED DEBUGGING with WINDBG. Introduction and Index
Posted
over 4 years ago
by
Alejandro Campos Magencio
1
Comments
Hi all, The other day I posted the list of commands I use on WinDbg when debugging .NET issues : SOS Cheat Sheet (.NET 2.0/3.0/3.5) . In the next few posts I will provide you with additional info and samples on how to use those commands. INDEX...
Decrypt my World
How to get LastLogon property for all users in a Domain (VBScript)
Posted
over 4 years ago
by
Alejandro Campos Magencio
4
Comments
Hi all, The following VBScript sample retrieves all users in Active Directory that haven't ever logged on the domain, or haven't logged on for at least maxDays (an argument passed to the script): On Error Resume Next ' Constants ' Const ONE_HUNDRED_NANOSECOND...
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...
Page 1 of 9 (215 items)
1
2
3
4
5
»
Translate This Page
Translate this page
Powered by
Microsoft® Translator