## 4 Case Study  
A test case study concerning user confidentiality and service availability is developed to demonstrate EDAS as a real-world prototype. The case study characterizes a tradeoff between confidentiality and availability. The case study is based on a general phenomenon that encrypting messages consumes more energy if longer key lengths are utilized and _vice versa_. Pre-shared keys and respective indexes are used in the case study. A higher index corresponds to a key with increased length. The state transition diagram depicting the case study security adaptation is shown in Figure 13. _Stable State 1_ is assumed to be the initial state. Different cipher key lengths for encrypting medical data are adapted when the _LowBattery_ or _ChargingUp_ events are generated by the temperature sensor.  
The case study consists of two scenarios to reflect a confidentiality-availability tradeoff situation. In the first scenario, EDAS decides to ensure service availability as opposed to keeping a high confidentiality level when the sensor battery level drops below a certain threshold. Therefore, encryption  
Figure 13: Adapting security to low availability/confidentiality risks.  
keys with decreased lengths are adapted to meet the primary requirement, availability, of a continuous patient monitoring system. In the second scenario, confidentiality is preferred over availability. Confidentiality is regained and key lengths are increased as the battery is recharged to a particular threshold, indicating that the sensor is steadily available to meet a particular service level. Key lengths are gradually increased and decreased as per the observation of threshold battery level events. This adaptation process is performed continuously until the sensor changes a state.
* Scenario 1 (Low Availability Risk: High Encryption with Low Battery)  
Low availability (context or directive) risk is raised when there is a _LowBattery_ event with the level being less than \(X\%\), and the encryption is still done with an increased key length. The corresponding risk is reduced when a _KeyChanged_ event is generated by the event source (temperature sensor) after a reduced encryption key length is adapted. The corresponding screenshots are displayed in Figures 14 and 15.  
* Scenario 2 (Low Confidentiality Risk: Low Encryption with High Battery)  
The low confidentiality alarm is raised when the _BatteryChargingUp_ event is detected with a level greater than \(Y\%\), and the encryption is still done with a reduced key length. The corresponding risk is reduced when an increased key length is adapted and a _KeyChanged_ event is discovered after increased key lengths are selected. See the corresponding screenshots in Figures 16 and 17.  
Figure 14: Scenario 1: sensor screen: decreased key lengths are adapted when battery level drops.  
Figure 15: Scenario 1: EDAS platform dashboard screen (modified): the _LowAvailability_ alarm is raised (as risk = 1) whenever a _BatteryLow_ event is detected and is reduced when a _KeyChanged_ event is observed after adaptation. Color legend: yellow, trigger event; red, alarm (unacceptable risk); green, alarm (acceptable risk); white, event detected.