diff --git a/data/answers.csv b/data/answers.csv index e7ad1ce..15f9226 100644 --- a/data/answers.csv +++ b/data/answers.csv @@ -4,8 +4,10 @@ D3.arff,D3.values,190 (3.0) D4.arff,D4.values,157 (3.0/2.0) D5.arff,D5.values,19 (2.0) diabetes.arff,diabetes.values,tested_positive (4.0) -hypothyroid.arff,hypothyroid.values,negative (2.0/1.0) iris.arff,iris.values,Iris-virginica (3.0) iris2D.arff,iris2D.values,Iris-versicolor (48.0/1.0) labor.arff,labor.values,good (3.99) -hypothyroid.arff,hypothyroid-min.values,negative (3366.31/2.0) +hypothyroid.arff,hypothyroid-2.values,negative (3366.31/2.0) +hypothyroid.arff,hypothyroid-4.values,negative (56.17) +hypothyroid.arff,hypothyroid-5.values,negative (30.75) +hypothyroid.arff,hypothyroid-9.values,negative (2.0/1.0) diff --git a/data/hypothyroid-min.values b/data/hypothyroid-2.values similarity index 100% rename from data/hypothyroid-min.values rename to data/hypothyroid-2.values diff --git a/data/hypothyroid-4.values b/data/hypothyroid-4.values new file mode 100644 index 0000000..087e3eb --- /dev/null +++ b/data/hypothyroid-4.values @@ -0,0 +1,9 @@ +TSH 7 +FTI 70 +TSH measured t +on thyroxine t +T4U measured t +thyroid surgery f +T3 2.1 +TT4 40 +referral source other \ No newline at end of file diff --git a/data/hypothyroid-5.values b/data/hypothyroid-5.values new file mode 100644 index 0000000..bd4ce9f --- /dev/null +++ b/data/hypothyroid-5.values @@ -0,0 +1,9 @@ +TSH 7 +FTI 70 +TSH measured f +on thyroxine f +T4U measured t +thyroid surgery f +T3 2.1 +TT4 40 +referral source other \ No newline at end of file diff --git a/data/hypothyroid.values b/data/hypothyroid-9.values similarity index 93% rename from data/hypothyroid.values rename to data/hypothyroid-9.values index 6ec5b13..169d33d 100644 --- a/data/hypothyroid.values +++ b/data/hypothyroid-9.values @@ -1,9 +1,9 @@ -TSH 7 -FTI 65 -TSH measured t -on thyroxine f -T4U measured t -thyroid surgery f -T3 2.1 -TT4 40 +TSH 7 +FTI 65 +TSH measured t +on thyroxine f +T4U measured t +thyroid surgery f +T3 2.1 +TT4 40 referral source other \ No newline at end of file diff --git a/libs/crypto.jar b/libs/crypto.jar index c07e9c3..e297d6a 100644 Binary files a/libs/crypto.jar and b/libs/crypto.jar differ diff --git a/src/main/java/weka/finito/client.java b/src/main/java/weka/finito/client.java index 2b3a9ca..3856e31 100644 --- a/src/main/java/weka/finito/client.java +++ b/src/main/java/weka/finito/client.java @@ -19,7 +19,6 @@ import security.paillier.PaillierKeyPairGenerator; import security.paillier.PaillierPrivateKey; import security.paillier.PaillierPublicKey; -import security.socialistmillionaire.bob; import security.socialistmillionaire.bob_joye; import weka.finito.structs.BigIntegers; @@ -291,7 +290,7 @@ private Hashtable read_features(String path, private void evaluate_with_server_site(Socket server_site) throws IOException, HomomorphicException, ClassNotFoundException { // Communicate with each Level-Site Object o; - bob client; + bob_joye client; // Create I/O streams ObjectOutputStream to_server_site = new ObjectOutputStream(server_site.getOutputStream()); @@ -334,7 +333,7 @@ private void communicate_with_level_site(Socket level_site) throws IOException, ClassNotFoundException, HomomorphicException { // Communicate with each Level-Site Object o; - bob client; + bob_joye client; // Create I/O streams ObjectOutputStream to_level_site = new ObjectOutputStream(level_site.getOutputStream()); @@ -412,7 +411,7 @@ public void run() { // Client needs to give server-site public key (to give to level-sites) // Client needs to know all possible classes... if (talk_to_server_site) { - // Don't send keys to server-site to ask for classes since now it is assumed level-sites are up + // Don't send keys to server-site to ask for classes now it is assumed level-sites are up setup_with_server_site(paillier_public_key, dgk_public_key); for (String aClass : classes) { hashed_classification.put(hash(aClass), aClass); diff --git a/src/main/java/weka/finito/level_site_thread.java b/src/main/java/weka/finito/level_site_thread.java index 906c5da..f7abc8e 100644 --- a/src/main/java/weka/finito/level_site_thread.java +++ b/src/main/java/weka/finito/level_site_thread.java @@ -2,7 +2,6 @@ import java.lang.System; -import security.socialistmillionaire.alice; import security.socialistmillionaire.alice_joye; import weka.finito.structs.BigIntegers; import weka.finito.structs.NodeInfo; @@ -42,7 +41,7 @@ public level_site_thread(Socket client_socket, level_order_site level_site_data) this.toClient.writeBoolean(true); closeClientConnection(); } else if (x instanceof Hashtable) { - for (Map.Entry entry: ((Hashtable) x).entrySet()){ + for (Map.Entry entry: ((Hashtable) x).entrySet()) { if (entry.getKey() instanceof String && entry.getValue() instanceof BigIntegers) { encrypted_features.put((String) entry.getKey(), (BigIntegers) entry.getValue()); } @@ -76,7 +75,7 @@ public final void run() { long start_time = System.nanoTime(); try { - alice niu = new alice_joye(); + alice_joye niu = new alice_joye(); niu.set_socket(client_socket); if (this.level_site_data == null) { toClient.writeInt(-2); diff --git a/src/test/java/PrivacyTest.java b/src/test/java/PrivacyTest.java index 28d3793..525469d 100644 --- a/src/test/java/PrivacyTest.java +++ b/src/test/java/PrivacyTest.java @@ -65,6 +65,7 @@ public void test_single_site() throws Exception { String full_feature_path = new File(data_directory, features).toString(); String full_data_set_path = new File(data_directory, data_set).toString(); System.out.println(full_data_set_path); + System.out.println("Features Vector: " + full_feature_path); String classification = test_server_case(full_data_set_path, full_feature_path, key_size, precision, server_ip, server_port); System.out.println(expected_classification + " =!= " + classification); @@ -113,6 +114,7 @@ public void test_all_level_sites() throws Exception { String full_feature_path = new File(data_directory, features).toString(); String full_data_set_path = new File(data_directory, data_set).toString(); System.out.println(full_data_set_path); + System.out.println("Feature Vector Path: " + full_feature_path); String classification = test_level_site(full_data_set_path, full_feature_path, levels, key_size, precision, level_site_ips, level_site_ports_string, server_ip, server_port); System.out.println(expected_classification + " =!= " + classification);