-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmedicine.php
53 lines (46 loc) · 1.73 KB
/
medicine.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
$patientName = $DoB = $OrganDonor = $Organ = $BloodPressure = $GlucoseLevel = $PhoneNumber = $BloodType = "";
if($_SERVER["REQUEST_METHOD"] == "POST"){
$patientName = test_input($_POST["p_name"]);
$DoB = test_input($_POST["DoB"]);
$OrganDonor = test_input($_POST["OrganDonor"]);
$Organ = test_input($_POST["Organ"]);
$PhoneNumber = test_input($_POST["number"]);
$BloodType = test_input($_POST["b_type"]);
//$BloodPressure = test_input($_POST["BloodPressure"]);
//$GlucoseLevel = test_input($_POST["GlucoseLevel"]);
$file = "NotEncrypted.txt";
$current = file_get_contents("NotEncrypted.txt");
$txt = $patientName.' '.$DoB.' '.$PhoneNumber.' '.$Organ;
$current.=$txt;
file_put_contents($file, $txt);
}
function test_input($data){
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
$keys = array(45312,2,67328);
// $GenerateKeyCommand = escapeshellcmd('python generateKeys.py');
// $keys = `python generateKeys.py`;
// echo $keys;
// $keys = explode("|", $keys);
// $arr = array_keys($keys);
$publicKeyE = $keys[1];
$publicKeyN = $keys[0];
$privateKey = $keys[2];
// echo $publicKeyN;
// print_r($keys);
// $EncryptCommand = escapeshellcmd('python EncryptMessage.py $publicKeyN $publicKeyE $patientName $DoB $OrganDonor');
// $EncryptMessage = `python EncryptMessage.py $publicKeyN $publicKeyE $patientName $DoB $OrganDonor`;
// $EncryptMessage = shell_exec($EncryptCommand);
// echo $EncryptMessage;
$file = "NotEncrypted.txt";
$current = file_get_contents("NotEncrypted.txt");
$txt = $patientName.' '.$DoB.' '.$PhoneNumber;
$current.=$txt;
file_put_contents($file, $txt);
header("http://localhost/HashCode/index.html/");
// echo "HELLO IM A BEAST";
?>