# A Secure CDM-Based Data Analysis Platform (SCAP) in Multi-Centered Distributed Setting
## 4 Results
### Implementation for CS  
Algorithms 3 and 4 show algorithms for generating a digital signature for the AC written by a user between the user (Algorithm 3) and CS (Algorithm 4), as shown in Figure 3. To analyze the CDM data intended by the user, the AC should not be tampered with by attackers while being transmitted to the SS. In addition, the author of the AC should be proven in an end-to-end manner. The user calls the request_to_sign_AC procedure with the AC and the token issued by the AS. This procedure requires the CS to issue a digital signature to guarantee the integrity of the AC. The procedure sends \(M_{\text{C}-CS}\) with its signature \(\mathit{sig}_{M_{\text{C}-CS}}\) (line 4 in Algorithm 3 for flow 1 in Figure 3). The message \(M_{\text{C}-CS}\) contains both the AC and a token. Upon receiving the request, the CS invokes the handle_signing_AC_request procedure. This procedure uses \(\mathit{sig}_{M_{\text{C}-CS}}\) to verify the integrity of the sender of \(M_{\text{C}-CS}\) (from lines 2 to 5 in Algorithm 4). The CS extracts the token from \(M_{\text{C}-CS}\) and checks the identity of the sender (from lines 7-11 in Algorithm 4). If any of these checks fail, the procedure returns an ERROR. Otherwise, the CS acquires AC from \(M_{\text{C}-CS}\) and generates a digital signature \(\mathit{sig}^{AC}\) (lines 13 and 14 in Algorithm 4). A hash algorithm, such as a secure hash algorithm (SHA) and a public key encryption algorithm (RSA [37] or ECDSA [38]) may be used to generate a digital signature. This procedure returns \(\mathit{MS}_{\text{C}-C}\), which wraps \(\mathit{sig}^{AC}\) and its signature \(\mathit{sig}_{M_{\text{C}-C}}\), to the user (from lines 16 to 18 in Algorithm 4 for flow 2 in Figure 3). When a response is received from the CS, the request_to_sign_AC procedure is resumed from line 4. This procedure validates \(\mathit{sig}_{M_{\text{C}-C}}\) to verify the message and sender (lines 6 to 9 in Algorithm 3). If the integrity stands, the procedure obtains and returns \(\mathit{sig}^{AC}\) from \(M_{\text{C}-CS-C}\) (line 12 in Algorithm 3). The user safely maintains the acquired \(\mathit{sig}^{AC}\). ```
1 Procedure request_to_sign_AC(AC, token)
2\(M_{\text{C}-CS}\leftarrow\) make a message with AC, token
3\(\mathit{sig}_{M_{\text{C}-CS}}\leftarrow\) generate a signature for \(M_{\text{C}-CS}\)
4\(M_{\text{C}-C}\), \(\mathit{sig}_{M_{\text{C}-C}}\leftarrow\) request to CS for signing AC with \(M_{\text{C}-CS}||\mathit{sig}_{M_{\text{C}-CS}}\)
5
6 sig_check \(\leftarrow\) verify \(\mathit{sig}_{M_{\text{C}-C}}\)
7 ifsig_check _failed_then
8 return ERROR
9
10 end if
11
12
13\(\mathit{sig}^{AC}\leftarrow\) get a signature for AC from \(M_{\text{C}-C}\)
14 return\(\mathit{sig}^{AC}\)
15 end if
16
17 end for
```  
**Algorithm 3**The code signing algorithm on the user side  
```
1 Procedure request_to_sign_AC(AC, token)
2\(M_{\text{C}-CS}\leftarrow\) make a message with AC, token
3\(\mathit{sig}_{M_{\text{C}-CS}}\leftarrow\) generate a signature for \(M_{\text{C}-CS}\)
4\(M_{\text{C}-CS}\leftarrow\) request to CS for signing AC with \(M_{\text{C}-CS}||\mathit{sig}_{M_{\text{C}-CS}}\)
5
6 sig_check \(\leftarrow\) verify \(\mathit{sig}_{M_{\text{C}-CS}}\)
7 ifsig_check _failed_then
8 return ERROR
9
10 end if
11
12 end for
13
14\(\mathit{sig}^{AC}\leftarrow\) get a signature for AC from \(M_{\text{C}-C}\)
15 return\(\mathit{sig}^{AC}\)
16
17 end for
```  
**Algorithm 4**The code signing algorithm on the user side  
```
1 Procedure request_to_sign_AC(AC, token)
2\(M_{\text{C}-CS}\leftarrow\) make a message with AC, token
3\(\mathit{sig}_{M_{\text{C}-CS}}\leftarrow\) generate a signature for \(M_{\text{C}-CS}\)
4\(M_{\text{C}-CS}\leftarrow\) request to CS for signing AC with \(M_{\text{C}-CS}||\mathit{sig}_{M_{\text{C}-CS}}\)
5
6 sig_check \(\leftarrow\) verify \(\mathit{sig}_{M_{\text{C}-CS}}\)
7 ifsig_check _failed_

### Implementation for TGS

Algorithms 5 and 6 show the algorithms used to issue a ticket for the user to access the SS between the user (Algorithm 5) and the TGS (Algorithm 6).