Year of Python (YOP) – Week Twenty Nine


Hello Reader!

Well this week we’re going to change gears a bit and re-visit a script from Week 11.  You might remember that script was a brute force File Vault script I created to use with the libfvde project.  Now the one issue with that script is if you stop it and start it back up, it has no way of knowing which keys it used before.  One of the plans for the larger program was to include a database portion to track the keys so if we needed to stop and re-run the program, the script would already have a database of what keys had already been tried.

So for this week, I’m starting to write the code to do the database portion of the overall script.

For the “framework” of this script, I pulled in some of the code from Week 11.  The goal was that we could still generate the random File Vault decryption keys, but add them to a database, and if necessary check the database for keys that were already used.

The first new function is the check_key function.  Here we’re passing the key to check, and the database to check against.  Then we look up the key in the database, and if it exists, we return a False statement.  This is to tell the overall program that the key has already been used and to try a new key.  Now if the key doesn’t exist, we add it to the database and return True.  This tells the overall program the key has NOT been seen before, so we’ll check it against the file vault image and see if it unlocks it.  Now this script doesn’t do the file vault image check, that will be part of the larger script when it’s completed.

But for now, all this script does is add the random keys to the database.  If you re-run the script, it will check to see if the key was generated before.  So if you want a database of random file vault recovery keys, this script will generate it for you!

Until next week!


No Responses Yet to “Year of Python (YOP) – Week Twenty Nine”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: