# Security Architecture for Swarms of Autonomous Vehicles in Smart Farming
## 3 Results
### Security Architecture for Swarms of Autonomous Vehicles
#### 3.2.1 Protection of Data Confidentiality  
Data confidentiality is about protecting data against unintentional or unauthorised access, disclosure or theft. The main method to protect data confidentiality is data encryption. Encryption is a process that renders data unreadable to anyone except those who have the proper key or password. The purpose of data encryption is to protect digital data confidentiality as it is transmitted through computer networks or stored on computer systems. Data encryption and decryption can be performed in two ways: (a) secret-key encryption (also known as symmetric encryption), in which the sender and receiver of the communication agree on a particular secret key used to encrypt and decrypt exchanged messages between them. The security of this method relies not only on the strength of the algorithm but also on the strength of the key itself. The most popular and secure symmetric encryption algorithm to date is AES (Advanced Encryption Standard). (b) For public-key encryption (also known as asymmetric encryption), the sender and receiver have two keys each, one for encryption (public) and one for decryption (private). All senders know the public key, but the private key is owned by the receivers only. Standard asymmetric encryption algorithms include RSA (Rivest- Shamir-Adleman), Diffie-Hellman and ECC (Elliptic Curve Cryptography). Although asymmetric encryption is more effective than the previous one, it penalises communications performance as the process takes longer and may not be suitable for cases with real-time constraints. Symmetric cryptography is designed precisely for the efficient processing of large volumes of data. The solutions and recommendations proposed to protect data confidentiality in the system under study are based on these alternatives and are described below:  
* Communication channel A: with the Mission Console being a web application accessible via browser, the best encryption solution in this case would be to use TLS [29], an updated version of its now-deprecated predecessor SSL (Secure Sockets Layer). TLS is a standardised technology that allows data traffic to be encrypted between a web browser and a web server by using the HTTPS protocol (HTTP Secure). OpenSSL [30] is proposed as a solution to provide TLS, and confidentiality could be implemented using the AES symmetric encryption algorithm. Security is granted in HTTPS by using digital certificates. TLS uses X.509 digital certificates to fulfil two functions: data encryption and authentication. Once installed, an X.509 certificate verifies the authenticity of a host or site through public key cryptography. After authentication (explained in Section 3.2.2), a one-time secret key is exchanged between entities, which is used to encrypt the data flow between the parties involved throughout the session. X.509 certificates are most reliable when issued by a trusted Certificate Authority (CA), which are organisms (e.g., Verisign) that must follow very strict policies regarding who to grant a TLS certificate. CA-issued digital certificates usually have a cost. In order to ensure compatibility, the CA must be listed in the Trusted Root Certificates of the browser. * Communication channel B: the Mission Console consumes the REST API offered by the SWARM Controller. As in the previous case, the best option to encrypt the HTTP channel between both entities would be to use TLS. An X.509 certificate must be installed on the SWARM Controller. The Mission Console must be configured to trust the CA of the certificate. Moreover, in order not to leak confidential information, a good practice when designing the REST API is to avoid transferring parameters in the URL of the services, always using HTTP request headers or bodies (e.g., HTTP POST and PUT methods) [31]. Communication channel C: as the SWARM Controller and the deployed vehicles do not share a physical connection (i.e., the former is deployed in the Cloud, while the latter use a 3G/4G connection), using a VPN (Virtual Private Network).