Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Blobby 10 password generation algorithm
<?php
// Blobby 10 zip-password generation algorithm.
array_shift($argv);
foreach ($argv as $zip) {
$p = '[';
$firstchar = ord($zip[0]);
$whitelisted_zips = array(
'9EIAC5FD.ZIP',
'91ANME59.ZIP',
'9SENDPDH.ZIP',
'5F2B9LSL.ZIP',
'9SCU0ONQ.ZIP',
'U65U93IG.ZIP',
'U1DGF1J2.ZIP',
'9SQPMQRE.ZIP',
'6PEH9R64.ZIP',
'9N3AGJII.ZIP',
'8HFO95QU.ZIP',
'6T71973I.ZIP',
'954RCU71.ZIP',
'9SIJ570N.ZIP',
'9EGA5T90.ZIP',
'92S43DMR.ZIP',
'90O3IM3D.ZIP',
'9NHUL71P.ZIP'
);
if (($firstchar != 0x55 /* 'U' */ ) && (!in_array($zip,$whitelisted_zips))) {
if (($firstchar > 0x2f) && ($firstchar < 0x3a)) {
foreach (array(1 => 2, 2 => 1, 3 => -1, 4 => 3, 5 => -1, 6 => -2, 7 => 0, 0 => 3) as $index => $rotation) {
$p .= chr(ord($zip[$index]) + $rotation);
}
foreach (array(3, 1, 6, 4, 0, 2, 7, 3) as $index) {
$p .= $zip[$index];
}
$p .= 'BLOB';
} elseif (($firstchar > 0x40) && ($firstchar < 0x4b)) {
foreach (array(3, 3, 1, 0, 5, 4, 6, 5, 2, 3) as $index) {
$p .= $zip[$index];
}
$p .= 'BLOB';
foreach (array(6, 7, 7) as $index) {
$p .= $zip[$index];
}
$p .= 'GOD';
} elseif (($firstchar > 0x4b) && ($firstchar < 0x56)) {
$p .= 'PKUNZIP';
foreach (array(2, 0, 7) as $index) {
$p .= $zip[$index];
}
$p .= 'RFCDFKSERD';
}
}
$p .= ']';
echo $zip.' '.$p."\r\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.