# A Study on the Design of Fog Computing Architecture Using Sensor Networks
## 3 Proposed System
### Communication Control by Access Authority  
A system adopting user attribute-based encryption sends data to a server via an access structure after encryption. A user who wants to share and use encrypted data of a service user requests decryption authority from a proxy server. A service user decides whether a person who requests decryption authority is a legitimate user and creates an attribute delegated key and sends it to a proxy server. In this system, a proxy server should have an attribute delegation list and an attribute revocation list. A proxy server checks the attribute delegation list and re-encrypts data using an attribute delegated key before providing it to a user.  
As shown in Figure 12, system components include a trusted authority, sensors, a proxy server, a cloud server and secondary user. Sensors generate data. A sensor can be a delegator that can delegate an authority. A secondary user is a user who can utilize information collected from a sensor. However, they need an authority of decryption before using data. They can be a delegate. A proxy sever  
Figure 11: Structure of Usage-Based Communication Control.  
collects and processes data transmitted from a sensor. Therefore, it should have sufficient memory and processing capability. In addition, it can re-encrypt data or process it with collected data, depending on circumstance. A cloud server processes information collected from a sensor. Furthermore, it collects and analyzes data received from a proxy server. It makes a decision using the results of analysis. It should learn information about decision making in advance to understand the personal data and effectively process it. It manages attribute delegation and revocation and monitors data.  
There are roughly six service scenarios using attribute-based encryption technology that allow delegation and revocation of an attribute.  
* A Trusted Authority (TA) defines system parameters using Setup (\(k\)) algorithm and creates the public key (\(pk\)) and the master key(\(mk\)). In addition, it creates two private key shares \(sk_{wlu,1}\) and \(sk_{wlu,2}\) relating to Attribute \(w\) and Public Key \(I_{u}\) and sends \(sk_{wlu,1}\) to a proxy server and \(sk_{wlu,2}\) to a sensor or a data owner, using KeyGen (\(mk\), \(w\), \(I_{u}\)) algorithm.
* A user transmits Ciphertext \(c_{\tau}\) that encrypts Data \(m\) using Encrypt (\(m\), \(\tau\), \(pk\)) algorithm. In this context, data refers to sensing data.
* A secondary user requests a decryption token (attribute set and ciphertext) to a proxy server to access Data \(m\) of the data owner.
* The data owner defines \(w^{\prime}\) based on his/her own attribute set \(w\) to delegate decryption authority for Ciphertext \(c_{\tau}\) to a secondary user. The data owner creates the private key share for a secondary user \(sk_{wlu,2}\) and the proxy server key to delegate an attribute \(sk_{w\to w^{\prime}}\) using his/her own private key share \(sk_{wlu,2}\) and the public key for a secondary user \(I_{j}\), and send them a secondary user (\(w^{\prime}\), \(sk_{w^{\prime}lu,2}\)) and the proxy server (\(sk_{w\to w^{\prime}}\)).  
Figure 12: Flow of Communication Control for Access Authority.  
* A proxy server creates its own private key share \(sk_{wlu,1}\), proxy key \(sk_{w\to w^{\prime}}\) and the private key share for a secondary user \(sk_{w^{\prime}lu,1}\) using the attribute set \(w^{\prime}\) defined by a patient. It re-encrypts the ciphertext \(c_{\tau}\) with the public key for a secondary user \(\text{I}_{j}\), \(sk_{w^{\prime}lu,1}\) and sends the re-encrypted ciphertext \(c_{\tau^{\prime}}\) to a secondary user.
* A secondary user obtains the data \(m\) by decoding the ciphertext \(c_{\tau^{\prime}}\) using the key received from the proxy server and the data owner \(sk_{w^{\prime}lu,2}\).