# A Usable Encryption Solution for File-Based Geospatial Data within a Database File System
## 3 Proposed Security Solution for Spatial Files
### Strong Encryption for Spatial Files
\begin{table}
\begin{tabular}{l c c c c c c c} \hline \hline \multirow{3}{*}{**Spatial File**} & \multirow{3}{*}{\begin{tabular}{c} **Filesize** \\ **(Mb)** \\ \end{tabular} } & \multicolumn{3}{c}{\begin{tabular}{c} **DBMS\_CRYPTO** \\ **on ECMSDK** \\ \end{tabular} } & \multicolumn{3}{c}{\begin{tabular}{c} **OpenSSL on** \\ **ECMSDK** \\ \end{tabular} } & \multicolumn{3}{c}{\begin{tabular}{c} **OpenSSL** \\ **on NTFS** \\ \end{tabular} } \\ \cline{2-7}  & & _Enc._ & _Dec._ & _Enc._ & _Dec._ & _Enc._ & _Dec._ \\ \hline \hline \multirow{2}{*}{\begin{tabular}{c} france-points.shp \\ \end{tabular} } & 1.50 & 1.13 & 1.07 & 0.48 & 0.17 & 0.04 & 0.04 \\ \hline \hline \multirow{2}{*}{\begin{tabular}{c} france-waterways.shp \\ \end{tabular} } & 6.32 & 4.73 & 4.49 & 1.02 & 0.29 & 0.06 & 0.05 \\ \hline \hline \multirow{2}{*}{\begin{tabular}{c} france-natural.shp \\ \end{tabular} } & 11.67 & 8.74 & 8.30 & 1.62 & 1.75 & 0.11 & 0.07 \\ \hline \hline \multirow{2}{*}{\begin{tabular}{c} indonesia-natural.shp \\ \end{tabular} } & 11.95 & 8.95 & 8.50 & 1.65 & 0.55 & 0.07 & 0.07 \\ \hline \hline \multirow{2}{*}{\begin{tabular}{c} germany-points.shp \\ \end{tabular} } & 13.89 & 10.41 & 9.88 & 1.87 & 0.92 & 0.07 & 0.14 \\ \hline \hline \multirow{2}{*}{\begin{tabular}{c} britain-waterways.shp \\ \end{tabular} } & 16.12 & 12.08 & 11.46 & 2.12 & 1.31 & 0.08 & 0.09 \\ \hline \hline \multirow{2}{*}{\begin{tabular}{c} china-buildings.shp \\ \end{tabular} } & 26.53 & 19.87 & 18.87 & 3.29 & 1.90 & 0.12 & 0.34 \\ \hline \hline \multirow{2}{*}{\begin{tabular}{c} india-natural.shp \\ \end{tabular} } & 32.13 & 24.07 & 22.85 & 3.92 & 2.38 & 0.13 & 0.37 \\ \hline \hline \multirow{2}{*}{\
\begin{tabular}{c} china-natural.shp \\ \end{tabular} } & 33.75 & 25.28 & 24.00 & 4.11 & 2.68 & 0.14 & 0.48 \\ \hline \hline \multirow{2}{*}{
\begin{tabular}{c} india-waterways.shp \\ \end{tabular} } & 36.21 & 27.13 & 25.75 & 4.38 & 2.77 & 0.15 & 0.56 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: AES encryption and decryption times (in seconds) for shapefiles within ECMSDK and on Windows filesystem. However, using OpenSSL on ECMSDK is still much slower than using OpenSSL to encrypt files stored directly on Windows NTFS--on average, it takes 15 times longer. This is due to the intermediary database layer between the encryption tool and the files. Nevertheless, the AES algorithm implemented in the OpenSSL tool provides satisfactory encryption-decryption performance. The results are quite good, as an average time of 8 Mb per second is quite reasonable and can be used practically for encrypting spatial files. For encryption and decryption of files in ECMSDK, the OpenSSL tool can be easily called externally using Oracle PL/SQL from within our scripts. The average OpenSSL AES encryption speed is about 0.15 s per megabyte, or about 2.5 min to encrypt or decrypt a 1 GB spatial file on a desktop machine (_1.6 GHz Intel i5-8265U_ CPU with _8 GB_ RAM). In our solution, the total computational cost is only the time required to complete the encryption-decryption operations shown in Table 1. Other than this, no additional overhead is associated with this scheme since the triggers that call these procedures execute instantaneously (see Section 4.4). These results can be improved. As encryption and decryption were carried out on a standard desktop, an enterprise server with a high-end multiple-CPU architecture and more RAM (for larger DB_CACHE_SIZE) could reduce the encryption speed drastically, at least by 20 times, which would be more suitable for enterprise GIS. Additionally, multi-processor UNIX servers can be used so that large files are split and then encrypted/decrypted simultaneously by multiple processors. This way, the resulting encryption time can be decreased, at least by multiples of the number of processors. Since AES is a very well-studied encryption algorithm and it presents us with reasonable encryption times for spatial files within a DBFS, we recommended its use.