[url=http://guide-to-the-galaxy.co.nf/diffie-hellman/]Diffie-Hellman App[/url]
Finally, Programmed this! :)
1. Each conversation is stored in a seperate file(in cyphertext) with a unique thread id. To create a new conversation or join one, enter the desired thread_id.
2. Now, we support alphanumeric private keys.
3. I've seen to it that the RC4 crypter handles not only decimal digits but also other kind of bytes when the shared_secret is entered.
4. p and g are as described in the other thread
***********************************************************************
[b]Source[/b]
index.php
[code]
Enter Thread Name
\n");
fwrite($f,"
\n");
echo "Message Entered
";
echo "Click here to go back";
exit;
}
else
{
echo rc4($s,base64_decode($message));
echo "
Click here to go back";
exit;
}
}
$A = fgets($f);
echo "Alice's Public Key: ". $A.'
';
if (!($A))
{if ($_GET['a'])
{
$p = '179769313486231590770839156793787453197860296048756011706444423684197180216158519368947833795864925541502180565485980503646440548199239100050792877003355816639229553136239076508735759914822574862575007425302077447712589550957937778424442426617334727629299387668709205606050270810842907692932019128194467627007';
$g = '2';
$a = numeralise($_GET['a']);
$A = bcpowmod($g,$a,$p);
fwrite($f,$A);
fwrite($f,"\n");
echo "Now Please Allow Bob to enter his private key. Give Bob this link or the thread name";
//header("Location: http://guide-to-the-galaxy.co.nf/diffie-hellman/index.php?thread=".$_GET['thread']);
exit;
}
else
{?>
Enter Alice's Private Key
';
if (!($B))
{if ($_GET['b'])
{
$p = '179769313486231590770839156793787453197860296048756011706444423684197180216158519368947833795864925541502180565485980503646440548199239100050792877003355816639229553136239076508735759914822574862575007425302077447712589550957937778424442426617334727629299387668709205606050270810842907692932019128194467627007';
$g = '2';
$b = numeralise($_GET['b']);
$B = bcpowmod($g,$b,$p);
fwrite($f,$B);
fwrite($f,"\n");
//header("Location: http://guide-to-the-galaxy.co.nf/diffie-hellman/index.php?thread=".$_GET['thread']);
echo "Now you are ready to compute the shared secret from here";
exit;
}
else
{?>
Enter Bob's Private Key
Compute Shared Secret and View Messages
Compute Shared Secret
Share a message
Read a message
All Messages
Chlamydomonas Labs
[/code]
computeAB.php //Contains more code than necessary because I am foolish
[code]
Press the back button in your browser to go back";
}
elseif ($_GET['s'])
{
$message=$_GET['message'];
$s = $_GET['s'];
echo base64_encode(rc4($s,$message));
echo '
';
echo rc4($s,base64_decode($message));
}
?>
[/code]