From 50fcba640ffe7551c5e44a7746bcb2ac78372863 Mon Sep 17 00:00:00 2001 From: AndrewQuijano Date: Wed, 3 Jan 2024 15:22:45 -0500 Subject: [PATCH] Type 6 should only use one comparison. One comparison per level will preserve timing attack proteciton --- README.md | 10 ++++++---- src/main/java/weka/finito/utils/shared.java | 16 ++++------------ 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index d216156..ed908eb 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,9 @@ Run this command and all future commands from `Level-Site-PPDT` folder, run the bash setup.sh ``` +Before you run the PPDT, make sure to create your keystore, this is necessary as the level-sites use TLS sockets. +Run the `create_keystore.sh` script, make sure the password is consistent with the Kubernetes secret. + ## Running PPDT locally 1. Check the `config.properties` file is set to your needs. Currently: @@ -162,7 +165,7 @@ You would point values to something like `/data/hypothyroid.values` ### Re-running with different experiments If you are just re-running the client with the same or different values file, just re-run the above command again. -Howver, if you want to test with another data set, best to just rebuild the environment by deleting everything first. +However, if you want to test with another data set, best to just rebuild the environment by deleting everything first. ```bash kubectl delete -f k8/client @@ -170,7 +173,7 @@ kubectl delete -f k8/server kubectl delete -f k8/level_sites ``` -Then just repeat the instructions on the previous section. +Then repeat the instructions on the previous section. ### Clean up Destroy the EKS cluster using the following: @@ -192,5 +195,4 @@ Code Authors: Andrew Quijano, Spyros T. Halkidis, Kevin Gallagher [MIT](https://choosealicense.com/licenses/mit/) ## Project status -Fully tested and completed. Future work currently includes: -* See if I can run this on AWS EKS too \ No newline at end of file +Fully tested and completed. Although I believe I need a label encoder to compare two strings. \ No newline at end of file diff --git a/src/main/java/weka/finito/utils/shared.java b/src/main/java/weka/finito/utils/shared.java index f8b2e15..1d3918f 100644 --- a/src/main/java/weka/finito/utils/shared.java +++ b/src/main/java/weka/finito/utils/shared.java @@ -74,7 +74,7 @@ public static NodeInfo traverse_level(level_order_site level_site_data, List node_level_data = level_site_data.get_node_data(); boolean terminalLeafFound = false; boolean equalsFound = false; - boolean inequalityHolds = false; + boolean inequalityHolds; int node_level_index = 0; int n = 0; int next_index = 0; @@ -95,19 +95,11 @@ public static NodeInfo traverse_level(level_order_site level_site_data, else { if ((n == 2 * level_site_data.get_current_index() || n == 2 * level_site_data.get_current_index() + 1)) { + if (ls.comparisonType == 6) { - boolean firstInequalityHolds = compare(ls, 3, + inequalityHolds = compare(ls, 1, encrypted_features, toClient, niu); - if (firstInequalityHolds) { - inequalityHolds = true; - } - else { - boolean secondInequalityHolds = compare(ls, 5, - encrypted_features, toClient, niu); - if (secondInequalityHolds) { - inequalityHolds = true; - } - } + inequalityHolds = !inequalityHolds; } else { inequalityHolds = compare(ls, ls.comparisonType,