# Protecting Hybrid ITS Networks: A Comprehensive Security Approach
## 3 Proposed Approach
### Implementation
#### 3.2.1 Obu  
The OBU equipment (present in vehicles) used was the Unex EVK-301E. Two main difficulties were encountered during its application development.  
The initial challenge arose from the difference between the execution and development environments. The execution environment was the equipment itself, which has an armv7-a architecture and a Linux Yocto operating system (OS). On the other hand, the development environment was an Ubuntu Linux 18.04 LTS 64-bit OS. Different compiling and running environments led to cross-compile and system library compatibility issues.  
The other challenge was how to send messages in the format proposed by the protocols (Figures 4 and 5). First, extending the messages (e.g., CAM) by adding additional fields was attempted. However, ITS messages are structured according to Abstract Syntax Notation One (ASN.1) definitions, leading to strict payload verification. Thus, only valid messages can be encoded (this also occurs in the RSU [44]). Therefore, the chosen approach involves incorporating the protocol's security bytes into the messages using optional fields. More precisely, the \"PathHistory\" field [21], was utilised within CAM messages. While the \"PathHistory\" field is not being employed with its intended semantics, it allowed the development of the application using real equipment (according to the established objectives), avoiding the need for protocol stack and software modifications on the equipment.  
Regarding the development of the OBU application, it was developed in the C programming language using the V2 Xcast software development kit (SDK) available for the Unex OBU. As defined in the architecture (Section 3.1), the OBU's application has two main services. These are responsible for transmitting locally generated and receiving messages from the G5 network. These services are simplified in Algorithms 1 and 2. As can be seen, both involve a conversion process that is necessary due to the previous issue. OpenSSL and [45] were used as cryptographic libraries.  
```
1:security_protocol: Security protocol object
2:functiontransmit_message
3:encoded_its_message\(\leftarrow\)cam_message_generation()
4:\(\triangleright\)secured_its_message is in protocol's proposed message format
5:encoded_its_message_extra\(\leftarrow\)transform_format(encoded_its_message)
6:\(\triangleright\)Insert security bytes into PathHistory
7:\(\ldots\)transmit via G5\(\ldots\)
8:endfunction
```  
**Algorithm 1** OBU app--Message transmission service (pseudo-algorithm)  
```
1:security_protocol: Security protocol object
2:security_protocol: Security protocol object
3:\(\triangleright\)E.g. a received CAM
4:\(\triangleright\)Convert to protocol's proposed message format
5:\(\mathit{valid\_its\_message}\leftarrow\)security_protocol.deprotection(secure_message)
6:if\(\mathit{valid\_its\_message}=None\)then
7:\(\ldots\)invalid message, discard it\(\ldots\)
8:else
9:\(\ldots\)message successfully verified, continue processing it\(\ldots\)
10:endif
11:endfunction
```  
**Algorithm 2** OBU app--Message receiving service (pseudo-algorithm)