# A Secure CDM-Based Data Analysis Platform (SCAP) in Multi-Centered Distributed Setting
## 4 Results
### Implementation of AS  
Algorithms 1 and 2 show the algorithms for issuing authentication tokens for users of the SCAP from Figure 2 (Algorithm 1) and the AS (Algorithm 2). Rather than operating individually, these algorithms fulfill their respective roles through synchronization.  
```
1 Procedureauthenticate(\(ID_{C}\)) \(M_{C-AS}\leftarrow\) make a message with \(ID_{C}\)\(sig_{M_{C-AS}}\leftarrow\) generate a signature for \(M_{C-AS}\)\(M_{AS-C}\), \(sig_{M_{AS-C}}\leftarrow\) request to \(AS\) for authentication with \(M_{C-AS}||sig_{M_{C-AS}}\)
5
6 sig_check\(\leftarrow\) verify \(sig_{M_{AS-C}}\)
7 ifsig_check_failedthen
8 returnERROR
9
10 end if
11
12 token\(\leftarrow\) get a token from \(M_{AS-C}\)
13 returntoken
14
15 end if
```  
**Algorithm 1**The authentication algorithm on the user side  
A user invokes an authenticate procedure with identity information \(ID_{C}\). This procedure creates an \(M_{C-AS}\) wrapping \(ID_{C}\) and its signature \(sig_{M_{C-AS}}\), and requests user authentication to AS (line 4 in Algorithm 1 for flow 1 in Figure 2). When the AS receives an authentication request from the user, it calls the handle_authentication procedure using \(M_{C-AS}\) and \(sig_{M_{C-AS}}\). This procedure verifies \(sig_{M_{C-AS}}\) to determine the integrity of  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Component** & **URL (Accessed date: 29 September 2021)** \\ \hline CA & [[https://github.com/KUSYS-LAB/Certificate-Authority-for-SCAP](https://github.com/KUSYS-LAB/Certificate-Authority-for-SCAP)]([https://github.com/KUSYS-LAB/Certificate-Authority-for-SCAP](https://github.com/KUSYS-LAB/Certificate-Authority-for-SCAP)) \\ RS & [[https://github.com/KUSYS-LAB/Web-Interface-for-SCAP](https://github.com/KUSYS-LAB/Web-Interface-for-SCAP)]([https://github.com/KUSYS-LAB/Web-Interface-for-SCAP](https://github.com/KUSYS-LAB/Web-Interface-for-SCAP)) \\ AS & [[https://github.com/KUSYS-LAB/Authentication-Server-for-SCAP](https://github.com/KUSYS-LAB/Authentication-Server-for-SCAP)]([https://github.com/KUSYS-LAB/Authentication-Server-for-SCAP](https://github.com/KUSYS-LAB/Authentication-Server-for-SCAP)) \\ CS & [[https://github.com/KUSYS-LAB/Code-Signer-for-SCAP-master](https://github.com/KUSYS-LAB/Code-Signer-for-SCAP-master)]([https://github.com/KUSYS-LAB/Code-Signer-for-SCAP-master](https://github.com/KUSYS-LAB/Code-Signer-for-SCAP-master)) \\ TGS & [[https://github.com/KUSYS-LAB/Ticket-Granting-Server-for-SCAP](https://github.com/KUSYS-LAB/Ticket-Granting-Server-for-SCAP)]([https://github.com/KUSYS-LAB/Ticket-Granting-Server-for-SCAP](https://github.com/KUSYS-LAB/Ticket-Granting-Server-for-SCAP)) \\ SS & [[https://github.com/KUSYS-LAB/Service-Server-for-SCAP](https://github.com/KUSYS-LAB/Service-Server-for-SCAP)]([https://github.com/KUSYS-LAB/Service-Server-for-SCAP](https://github.com/KUSYS-LAB/Service-Server-for-SCAP)) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Repositories for SCAP.  
\(M_{\text{C}-AS}\) and the sender (from lines 1-5 in Algorithm 2). If \(\mathit{sig}_{M_{\text{C}-AS}}\) fails, the AS returns an appropriate ERROR to the user. Otherwise, AS uses \(ID_{\text{C}}\) to check whether the sender is a registered user on the SCAP platform (from lines 7-11 in Algorithm 2). If the user is not registered, the AS returns an ERROR. When a full verification is successfully completed, AS generates a token based on cryptography and returns \(M_{AS-C}\) and its signature \(\mathit{sig}_{M_{AS-C}}\) to the user (line 16 in Algorithm 2 for flow 2 in Figure 2). When the AS returns a token or ERROR, the execution of the authenticate procedure resumes from line 4. The user verifies \(\mathit{sig}_{M_{AS-C}}\) to verify the integrity and source of \(M_{AS-C}\) (from lines 6-9 in Algorithm 1). If \(M_{AS-C}\) is not created by the correct AS or is corrupted during network communication, the authenticate procedure returns an ERROR. Otherwise, it obtains a token from \(M_{AS-C}\) and returns it (line 12 in Algorithm 1). The user stores the acquired tokens safely during their local storage.