From 1fe3879dd286d15b918f369f1a3902dc8183c950 Mon Sep 17 00:00:00 2001
From: robin ";
echo `echo " a(1)*4" | bc -l `;
echo "A ";
diff --git a/decode.php b/decode.php
index 56b834b..640c4cb 100644
--- a/decode.php
+++ b/decode.php
@@ -2,6 +2,19 @@
";
diff --git a/encode.php b/encode.php
index 273706b..edd0ec4 100644
--- a/encode.php
+++ b/encode.php
@@ -2,6 +2,16 @@
The Numbers
+
+$e = $_POST['e'];
+$d = $_POST['d'];
+$p = $_POST['p'];
+$n = $_POST['n'];
+$q = $_POST['q'];
+$phi = $_POST['phi'];
+$mprivate = $_POST['mprivate'];
+
echo " p $p q $q";
$big_num = `echo $p^$q | bc | sed -f /var/www/html/rsa/nlhtml.sed `;
//$big_num = `echo $p^$q | bc | sed -f /home/robin/scripts/nlhtml.sed `;
diff --git a/calc_pi.php b/calc_pi.php
index f65eaa0..d75eefc 100644
--- a/calc_pi.php
+++ b/calc_pi.php
@@ -2,6 +2,13 @@
PI - calculated to required precision
+$e = $_POST['e'];
+$d = $_POST['d'];
+$p = $_POST['p'];
+$n = $_POST['n'];
+$q = $_POST['q'];
+$phi = $_POST['phi'];
+$mprivate = $_POST['mprivate'];
if ( $precision < 1 ) { $precision = 100; }
diff --git a/cbe.php b/cbe.php
index 2493b23..f5dec0b 100644
--- a/cbe.php
+++ b/cbe.php
@@ -1,6 +1,15 @@
+
+$e = $_POST['e'];
+$d = $_POST['d'];
+$p = $_POST['p'];
+$n = $_POST['n'];
+$q = $_POST['q'];
+$phi = $_POST['phi'];
+$mprivate = $_POST['mprivate'];
+
echo "arggggh why wont you call this script $m $e $n Encode integer 'm'
+
+$c = $_POST['c'];
+$m = $_POST['m'];
+$e = $_POST['e'];
+$e = $_POST['e'];
+$d = $_POST['d'];
+$p = $_POST['p'];
+$n = $_POST['n'];
+$q = $_POST['q'];
+$phi = $_POST['phi'];
+$mprivate = $_POST['mprivate'];
+
+
echo " Decodes the ciphered integer using the secret 'd' key : m = c^d mod n.
\n";
//echo "d == $d Encode integer 'm'
+$e = $_POST['e'];
+$d = $_POST['d'];
+$p = $_POST['p'];
+$n = $_POST['n'];
+$q = $_POST['q'];
+$phi = $_POST['phi'];
+$mprivate = $_POST['mprivate'];
+$m = $_POST['m'];
+
+echo " in encode.php m is $m
";
echo " Computes the cipher text c = m^e mod n.
";
echo " $m^$e%$n
";
$digits = `./pow_digits $m $e`;
diff --git a/encode_pub.php b/encode_pub.php
index 69b98ff..92755e5 100644
--- a/encode_pub.php
+++ b/encode_pub.php
@@ -6,6 +6,18 @@
RSA Interactive Simulator / Work Bench : Encoding data with the public Key
+$c = $_POST['c'];
+$e = $_POST['e'];
+$d = $_POST['d'];
+$p = $_POST['p'];
+$n = $_POST['n'];
+$q = $_POST['q'];
+$phi = $_POST['phi'];
+$mprivate = $_POST['mprivate'];
+$m = $_POST['m'];
+
+
+//printf(" in encode_pup.php m is %s
",$m);
If ( $n < 1 || $e < 1 || $d < 1 ) {
diff --git a/find_d.php b/find_d.php
index 1711243..98e453d 100644
--- a/find_d.php
+++ b/find_d.php
@@ -2,6 +2,17 @@
Find d, the private key
+$e = $_POST['e'];
+$d = $_POST['d'];
+$p = $_POST['p'];
+$n = $_POST['n'];
+$q = $_POST['q'];
+$phi = $_POST['phi'];
+$mprivate = $_POST['mprivate'];
+
+printf("IN FIND D");
+
+printf(" PHI is %s
",$phi);
//echo "debug n==$n";
diff --git a/find_phi.php b/find_phi.php
index 6cca28b..0b30d54 100644
--- a/find_phi.php
+++ b/find_phi.php
@@ -2,6 +2,16 @@
Generating PHI the secret Modulus
+ $p = $_POST['p'];
+ $q = $_POST['q'];
+ $e = $_POST['e'];
+$d = $_POST['d'];
+$p = $_POST['p'];
+$n = $_POST['n'];
+$q = $_POST['q'];
+$phi = $_POST['phi'];
+$mprivate = $_POST['mprivate'];
+
$big_num = `echo "($p-1)*($q-1)" | bc `;
diff --git a/gcd.php b/gcd.php
index 11ee60c..477d41d 100644
--- a/gcd.php
+++ b/gcd.php
@@ -2,6 +2,18 @@
The Numbers
+
+
+$e = $_POST['e'];
+$d = $_POST['d'];
+$p = $_POST['p'];
+$n = $_POST['n'];
+$q = $_POST['q'];
+$phi = $_POST['phi'];
+$mprivate = $_POST['mprivate'];
+
+
+
//echo " gcd($e,$phi) == ";
$big_num = `echo "a=$e; b=$phi; while(b) {a=a%b; r=b; b=a; a=r;}; a;" | bc `;
diff --git a/generate_key.php b/generate_key.php
index 1ee2d2c..d8010a5 100644
--- a/generate_key.php
+++ b/generate_key.php
@@ -42,6 +42,26 @@ For full RSA simulations a bc
and on-line here .