Taswar Bhatti
Practical guides on AI agents, LLM security, C#/.NET and Cloud, from Taswar Bhatti
Archive: May 2018
X509_certficiate_serial_with_Csharp_or_Python

In this blog post I wanted to show how one can use C# or Python to view the serial numbers of a X509 certificate. The serial number can be used to identify the certificate that one plans to use in their C# application, lets say for mutual authentication to another service.

Why use X509 Certificates

  1. Client X.509 certificate identity adds an additional level of asymmetrical cryptography to the standard SSL/TLS channel.
  2. Long security keys (2046 bits)
  3. One can revoke certificates by using Certificate Revocation List (CRL).
  4. Easy to use in application to application

View X509 Certificate Serial Number using C#

If you are using dotnetcore first create a console app using the command below

The command above will create … Read the rest “View X509 Certificate Serial Number using C# or Python”

Powershell-dpapi

I wanted to store some data into registry but how do I store it such that it is secure for my application to read later on. Well there is a way using Powershell to store data into Registry using DPAPI which uses the machine key to store the information. As you know the only way to store data securely is by using encryption and DPAPI provides us with that.

What is DPAPI?

From Wikipedia we get this definition

Now that we know it uses the machine key we can write some code to store some value into our registry using powershell. We will be writing into the Wow64 registry since we will most likely use a 64bit application later on. If you need to write to 32bit also just remove the wow64node.

Powershell using DPAPI to store secure data in

… Read the rest “Powershell using DPAPI to store secure data in Registry”
UA-4524639-2