Skip to content

Commit d94bcb5

Browse files
authored
add reversal of sufficiently long PPPs
If you generate a PPP that's sufficiently long by the ppp.exe from GRC (probably at least 20 chars, but if you get exclamation marks at the end [remainder 0] you're good to go) you can reverse the initial quotient, i.e. the encrypted secret.
1 parent ed7f3d4 commit d94bcb5

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

ppp-rev.php

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
require('bigint.php');
3+
header("Content-Type: text/plain");
4+
$ppp="L:k66XiKLeiPMYxf8H!5%%!";
5+
$set="!#%+23456789:=?@ABCDEFGHJKLMNPRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; //character set
6+
//make set and ppp into array
7+
$seta=str_split($set);
8+
$pppa=str_split($ppp);
9+
//get number array
10+
$char=array_pop($pppa);
11+
while($char!==null) {
12+
$charna[]=array_search($char,$seta);
13+
$char=array_pop($pppa);
14+
}
15+
//var_dump($charna); //throw the array
16+
17+
$num=new Math_BigInteger(array_shift($charna));
18+
$charn=array_shift($charna);
19+
while($charn!==null) {
20+
//bla=bla*set
21+
//bla+next
22+
//bla+(setxnext)
23+
echo "prev: ".$num->toString()." Setcount: ".count($seta)." Remainder (from PPP): ".$charn."\n";
24+
$num=$num->multiply(new Math_BigInteger(count($seta)));
25+
$num=$num->add(new Math_BigInteger($charn));
26+
$charn=array_shift($charna);
27+
}
28+
echo "\n\n"."Final Number: ".$num->toString().' Hex: '.$num->toHex();
29+
?>

0 commit comments

Comments
 (0)