Last active
August 29, 2015 13:57
-
-
Save aaronhurt/9834877 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (php_sapi_name() !== 'cli') { | |
die('This script may only be run from the command line.' . "\n"); | |
} | |
if ($argc < 2) { | |
die('Usage: ' . $argv[0] . ' <encryption key>' . "\n"); | |
} | |
$key = substr(str_pad($argv[1], 16, "\0"), 0, 16); | |
$iv = substr(md5($key), 0, 8); | |
printf("key bin\t== %s\nkey hex\t== %s\n", $key, strtoupper(bin2hex($key))); | |
printf("iv bin\t== %s\niv hex\t== %s\n", $iv, strtoupper(bin2hex($iv))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment