Author image

Valiant Keygen


A keygen written in Python, released for educational purposes.

A key generator, or keygen for short, is a program, used in cryptography, that aims to beget a random number that can be used for encryption and decryption at 2 ends of a communication channel.

Brief walkthrough the code: We create a string key given a number of possible characters (here all alphanumeric chars in caps and without, as well as all 10 numbers) and we compute its checksum through a trivial hash function here (ord). We accumulate the result and we crosscheck with foundValueThroughDbg to figure out if the number we found has any relevance to the value found through the debugger. If we find at least one key that matches it means, then foundValueThroughDbg pinpoints a correct value, that can be used to generate many available passwords that will authenticate access to a secured program. Just input one of those passwords and you will be granted access.

This is just a demo of how a keygen would work and how one would go about creating it. The case here is trivial for a program I made (that I can no longer find..). But I used OllyDbg to uncover the foundValueThroughDbg value. This is the hard part.. scouring the debugger for hints which may pinpoint a key generation procedure. We can reverse engineer the process by creating a key generator that can spit out identical passwords, which we can use for our profit.


Github repository link.