The Luhn Algorithm

Created by the german IBM scientist Hans Peter Luhn, the Luhn Algorithm is a checksum formula being used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers etc.

In this blog post, I will show you some functions I created that uses this algorithm. It can be used to calculate a checksum digit from a number, as well as validate numbers using the Luhn Algorithm checksum validation.


Binary/String conversion using Win32 API

I recently came across the Matasano Crypto Challenges, which is a set of challenges you can go through to learn more about cryptography.

While looking around for tips online for the first challenge, I stumbled upon an excellent blog article by Vadims Podāns, where he shows how, by using the Win32 native functions CryptStringToBinary and CryptBinaryToString, you can easily convert between binary and string in PowerShell. (more…)

C# vs PowerShell Operators

Being able to read C# is a huge plus when doing advanced scripting, if for no other reason than most examples in the .NET documentation are given as C# (or Visual Basic). Luckily for us, understanding C# isn’t that hard when you have worked with PowerShell a while. But one of the areas where they can differ a bit are the operators. I have created this Cheat Sheet as a tool to be able to quickly translate between C# operators and the PowerShell equivalent. (more…)