# Safe and Policy Oriented Secure Android-Based Industrial Embedded Control System
## 3 Policy Oriented Security Scheme
### Algorithm License Permituition Unit (ALPU)  
The ALPU is a high-performance illegal copy protection chip applied in different electronic systems such as dashboard cameras, navigation systems, and industrial controllers. It is very suitable for embedded systems, considering its small size and low power requirements. The encryption module is based on a Rijndeal AES-128 standard with 192-bits programmable parameters. The module consists of several blocks which are the AES-128 encryption module, the encryption parameters, feedback buffers, and the hash generator. Figure 3a shows our own developed embedded system, namely JECS-600 ITX, attached with an ALPU. The ALPU offers three modes of authentication: bypass mode, feedback encryption mode, and hash generator mode. The bypass mode is only used in testing the communication between the ALPU and the main controller--in this case, the JECS-600 ITX. The ALPU will perform exclusive or (XOR) operation with 0x01 on the received data and return it back to the JECS-600 ITX. On the other hand, feedback encryption and hash generator are encryption methods developed by Newowine. In this paper, we focus on the hash generator mode, which is a variation of SHA-256 and is the strongest encryption algorithm available within the ALPU. Aside from the ones stored in the ALPU itself, these algorithms are distributed as a library, and used for encrypting the authentication key stored in the main controller. The authentication key is only known to the user and is unique for every ALPU chip, ensuring that the authentication process fails in cases where a different ALPU chip is attached. Figure 3b illustrates the authentication process of the ALPU. The stored authentication key in the JECS-600 ITX is encrypted depending on the selected mode of encryption. Together with the mode of encryption, the encrypted data (ENC Data) are transmitted to the ALPU through I\({}^{2}\)C protocol. Users can set the number of passes to apply the encryption algorithm, which makes the key more difficult to analyze, thereby increasing security. The complete steps of the authentication process are as follows:  
* The stored authentication key in the JECS-600 ITX is encrypted using the encryption library depending on the selected mode. The encrypted data are then transmitted to the ALPU;
* Upon receipt, the ALPU decrypts the data and process them with the encryption module based on the stored key value and parameters. The results are transmitted back to the JECS-600 ITX;
* Back in the JECS-600 ITX, the encrypted authentication key is compared with the response from the ALPU. The authentication process is successful when both are the same;
* In contrast, the authentication fails if one of the keys is different from the other, which can invoke a system halt or shutdown depending on the procedure implemented by the developer. Due to the encryption library being specifically made compatible only with the Linux operating system, we have ported it to be compatible with both the bootloader and Android. In the case of the bootloader, we have created a new bootloader command including the ported encryption library and  
Figure 3: JECS-600 ITX with Algorithm License Permituition Unit (ALPU): (**a**) actual hardware; (**b**) authentication process. the I\({}^{2}\)C interface files to implement the authentication process as explained above. The new command is added to the list of bootloader commands and the board initiation process. With the ultimate goal of protecting the embedded system from running unauthorized applications, we have developed an Android API including the encryption library that can be added to user-authorized applications. Note that the encryption key is compiled within the developed encryption library to prevent numerous developers from accessing it. This means that a unique library should be compiled for each ALPU. To distinguish between unauthorized and authorized applications, we have developed a security manager daemon that continuously checks whether an application contains the developed encryption API.