Securing AI Systems A Comprehensive Overview of Cryptographic Techniques For Enhanced Confidentiality and Integrity
Securing AI Systems A Comprehensive Overview of Cryptographic Techniques For Enhanced Confidentiality and Integrity
Jose Luis Cano Garcia1 , Izuchukwu Patrick Udechukwu1 , Isiaq Bolaji Ibrahim1 , Ikechukwu John Chukwu1 , Hasan Dağ1 , Vesna
Dimitrova2 , and Elissa Mollakuqe*1
and evolve based on data.. Machine learning (ML) is used to separate validation datasets or through techniques like k-fold
teach machines how to handle the data more efficiently [18]. cross-validation. This evaluation phase is critical in assessing
As Arthur Samuel defined, ML is the field where computers the model’s generalization ability and ensuring its reliability
learn without explicit programming. This learning process can in real-world scenarios. Finally, the culmination of the ML
be broadly categorized into three types: supervised learning, lifecycle involves deploying the trained model into produc-
unsupervised learning, and reinforcement learning, each tai- tion environments, where it becomes accessible to end-users
lored for specific tasks.. Effective data preparation is crucial through various interfaces or integration into existing systems.
in ensuring the quality and relevance of training data, while This deployment phase requires careful consideration of fac-
feature extraction transforms raw data for meaningful learning. tors such as scalability, latency, and ongoing monitoring to
Evaluation metrics serve as quantitative measures to assess ensure the model’s continued effectiveness and relevance. By
the model’s performance, providing insights into its accuracy, providing users with an extended explanation of these founda-
precision, recall, and other critical attributes. Common evalua- tional steps in the ML lifecycle, they gain a deeper appreciation
tion metrics include accuracy, precision, recall, F1 score, and for the complexities involved in building and deploying ML
mean squared error (MSE) [10] [8] . solutions. (Reference: Géron, A. (2019). Hands-On Machine
Learning with Scikit-Learn, Keras, and TensorFlow: Concepts,
Artificial Intelligence and Neural Networks Tools, and Techniques to Build Intelligent Systems. O’Reilly
Artificial intelligence (AI) and neural networks (NN) [2] are Media.)
closely related concepts. However, the terms are often wrongly
used interchangeably. The components of NN consist of Neurons, Layers, and Ac-
tivation Functions. The functionality of a neuron involves
AI is a broader term that encompasses NN. Neural Networks summing the weighted inputs, adding a bias, and applying
(NNs) stand as the cornerstone of modern machine learning, an activation function to determine the neuron’s output and
embodying a paradigm shift in computational approaches and shape NN behavior. The layers receive raw data, process and
exhibiting a transformative impact on diverse applications. extract features from this information and output the final
The Neural Network mimics the intricate structure and func- result... Key activation functions include sigmoid function ,
tioning of the human brain composed of interconnected nodes, hyperbolic Tangent (tanh), and Rectified Linear Unit, Under-
or neurons, organized into layers. NNs process information standing activation functions is crucial for tailoring NNs to
through a series of weighted connections, collectively enabling specific applications. One popular NN such as Convolutional
complex computations and pattern recognition. This architec- Neural Network has revolutionized the field of computer vi-
ture allows NNs to tackle tasks that traditional algorithms find sion, proving instrumental in tasks such as image recognition
challenging, such as image and speech recognition, natural and object detection [14]. [4] describes CNN as the con-
language processing, and complex decision-making. Through cept of hierarchical feature detectors in a biologically inspired
a process called training, NNs adjust their parameters based manner. It can learn highly abstract features and can identify
on input output pairs, gradually refining their ability to make objects efficiently [26]. Due to lesser parameters, CNN can be
accurate predictions or classifications. The transformative trained smoothly and does not suffer overfitting [21]. CNNs
impact of Neural Networks reverberates across industries, re- are widely being used in various domains due to their remark-
shaping the landscape of technology, healthcare, finance, and able performance [24] such as image classification [12] [25]
more. [3], object detection [22], face detection, speech recognition
[19], vehicle recognition [14], diabetic retinopathy [5], facial
Neural Network Components: Neurons, Layers, and Acti- expression recognition [23] and many more.
vation Functions
Integrating a section on the inner workings of machine learn- Data encryption
ing (ML) expands users’ understanding of how these systems Encryption is the process of converting a piece of data from
are engineered and readied for practical use. Breaking down its original form into an unintelligible form. The original
the process into simple steps elucidates the journey from raw representation of the information is known as plaintext and the
data to deployable ML models. Initially, data acquisition lays encrypted representation is known as ciphertext. The purpose
the groundwork, where a diverse array of datasets is collected of encryption is to provide confidentiality to sensitive data of
from various sources relevant to the task at hand. Following any type, not by preventing access to the data but by making
this, preprocessing steps such as data cleaning, feature selec- the content not intelligible to a potential interceptor.
tion, and normalization are undertaken to refine the dataset
and prepare it for effective model training. The pivotal phase Two main kinds of encryption are symmetric encryption and
of model selection and training ensues, wherein appropriate asymmetric encryption.
algorithms are chosen based on the nature of the data and the
Typically, a key and an algorithm are used to perform data
objectives of the ML project. Through iterative training on
encryption. A secure encryption process should be designed
the prepared dataset, the selected model learns patterns and in such a way that it would be impractical to decrypt the mes-
relationships within the data, continually refining its predictive sage without possessing the key. In principle, only authorized
capabilities. This iterative process often involves techniques parties can decrypt a ciphertext and access the original data.
such as cross-validation to ensure robust performance and pre-
vent overfitting. Once the model achieves satisfactory perfor- Specific encryption algorithms and approaches are discussed
mance during training, it undergoes rigorous evaluation using in section 4.
Authorized licensed use limited to: Universidad Industrial de Santander. Downloaded on October 16,2024 at 04:12:01 UTC from IEEE Xplore. Restrictions apply.
2024 13th MEDITERRANEAN CONFERENCE ON EMBEDDED COMPUTING (MECO), 11-14 JUNE 2024, BUDVA, MONTENEGRO
Authorized licensed use limited to: Universidad Industrial de Santander. Downloaded on October 16,2024 at 04:12:01 UTC from IEEE Xplore. Restrictions apply.
2024 13th MEDITERRANEAN CONFERENCE ON EMBEDDED COMPUTING (MECO), 11-14 JUNE 2024, BUDVA, MONTENEGRO
Authorized licensed use limited to: Universidad Industrial de Santander. Downloaded on October 16,2024 at 04:12:01 UTC from IEEE Xplore. Restrictions apply.
2024 13th MEDITERRANEAN CONFERENCE ON EMBEDDED COMPUTING (MECO), 11-14 JUNE 2024, BUDVA, MONTENEGRO
Authorized licensed use limited to: Universidad Industrial de Santander. Downloaded on October 16,2024 at 04:12:01 UTC from IEEE Xplore. Restrictions apply.
2024 13th MEDITERRANEAN CONFERENCE ON EMBEDDED COMPUTING (MECO), 11-14 JUNE 2024, BUDVA, MONTENEGRO
attacks. Not associated with privacy-preserving computations. production data processing. Encrypting and decrypting data is
The addition of salt is a lightweight and recommended security usually time-consuming and would impact the performance
practice. of the consumer application. Also, the data is treated as plain
text during the training and recognition steps, in such steps the
DISCUSSION AND SOLUTION PROPOSAL encryption algorithm could not protect against an attack that
In this section, we discuss the different cryptographic tech- aims to steal the data or model.
niques mentioned in the previous section and propose one that Based on this we believe that a NN service system that deals
can address the vulnerabilities and attacks described in the with sensitive data and wants to protect its intellectual property
corresponding section. needs to deal with encrypted data at all times. This would lead
Our proposal aims to provide the reader with a list of suitable to the following approach:
cryptographic techniques that can be used as a reference to se- • Collect and encrypt training data
cure AI systems consisting of neural networks. This proposal • Store the encrypted training data
is especially important for off-premise models that offer their • Train the NN model using the encrypted data
functionality as services in the cloud. • Encrypt production data before sending it to the model for
As a recap of our previous analysis, we find that the most analysis
important assets to protect in a neural network can be defined • Use the encrypted production data as input to the model
as part of the following broad groups [15]: • Send the encrypted result to the client
• Training Data Set Using this approach, the data is always protected as it is never
• Trained NN model treated as plain text. Now, from our cryptographic analysis
• Production data in section 4, it is clear that homomorphic encryption (HE)
suits this application better than the other encryption methods
The solution should provide these assets with integrity and due to its capability to enable operations on encrypted data
confidentiality to meet the privacy and good functioning of the without the need for a previous decryption step [6]. Avoiding
system. the overhead of the first approach.
These assets are data and encryption being a way of making Different schemes of HE have been developed, however, the
data unintelligible comes as a natural solution for protecting proposed solution is to use the CKKS scheme, since it is the
these assets. preferred algorithm to evaluate machine learning models on
Production and training data sets can potentially contain sen- encrypted data [11].
sitive data, for example, on AI systems performing biometric With this approach, the confidentiality of the data can be en-
recognition. It is clear then that these data sets must be en- sured. However, the data could still be manipulated by an
crypted, however, we need to define when and how. Generally attacker and the integrity of the model and training data could
speaking, sensitive data can be handled as part of the following be compromised as mentioned in section 4. Therefore, an
processes: integrity protection measure needs to be set in place as well.
• Training Data Collection Considering the client-server model where a trustworthy client
• Training Data Storage sends valid production and training data to the server, the use
• Model training of digital signatures is an option for validating the integrity
• Production data analysis and authenticity of the received data. If the data was modified
by a third entity at any moment then the server can reject it to
Hence, one approach for protecting the data through encryp- prevent data poisoning.
tion could consist of the following steps:
Finally, validating the client’s data does not ensure that our
• Collect and encrypt training data model has not been modified. So we propose to sign the model
• Store the encrypted training data data itself, so its integrity can be confirmed before loading it.
• Decrypt the training data and train the NN model If the data of the model has been modified in any way then the
• Delete decrypted data system should refuse to run it.
• Encrypt production data before sending it to the model for
analysis In terms of the specific encryption algorithm to be used for the
• Decrypt the data before passing it as input to the model signing process we propose the use of the Elliptic Curve Digi-
• Delete the decrypted production data tal Signature Algorithm (ECDSA) [20], which as mentioned in
• Encrypt the result and send it to the client our algorithms analysis can use a shorter key length compared
to RSA when calculating digital signatures and yet maintain
However, after training the NN, the training data is embedded a high level of security. This characteristic allows ECDSA to
into the model’s parameters too, which makes it possible for provide high-security performance at a lower hardware cost
an attacker to reverse engineer the model and recover the than RSA. It is worth noting that international organizations
original training data. Hence, the model has to be encrypted such as ISO, ANSI, NIST, and IEEE have accepted ECDSA
as well under this approach. This is possible as a NN model as a standard.
can conceptually be seen as plain text. In such a case the
model would need to be decrypted every time a client requests
Authorized licensed use limited to: Universidad Industrial de Santander. Downloaded on October 16,2024 at 04:12:01 UTC from IEEE Xplore. Restrictions apply.
2024 13th MEDITERRANEAN CONFERENCE ON EMBEDDED COMPUTING (MECO), 11-14 JUNE 2024, BUDVA, MONTENEGRO
The unauthorized access to these assets can have serious con- [6] Ran Gilad-Bachrach, Nathan Dowlin, Kim Laine,
sequences for a company. Included but not limited to: Kristin Lauter, Michael Naehrig, and John Wernsing.
2016. CryptoNets: Applying Neural Networks to
• Sensitive data privacy breach Encrypted Data with High Throughput and Accuracy. In
• Model stealing (Intellectual property theft) Proceedings of The 33rd International Conference on
• Data poisoning and manipulation Machine Learning (Proceedings of Machine Learning
These could eventually cause a company to face legal repercus- Research), Maria Florina Balcan and Kilian Q.
sions for sensitive data loss or even unfair competition from Weinberger (Eds.), Vol. 48. PMLR, New York, New
companies using stolen models. York, USA, 201–210. https:
//proceedings.mlr.press/v48/gilad-bachrach16.html
Different approaches can be used to protect these assets. How-
ever, a cryptographic approach was taken in this paper. Based [7] Google. 2024. Single Cloud TPU Device Pricing. (2024).
on our analysis of existing cryptographic techniques and vul- https://cloud.google.com/tpu/
nerabilities in neural networks, we conclude that the best way [8] Trevor Hastie, Robert Tibshirani, and Jerome Friedman.
to preserve the data and model confidentiality is to solely han- 2009. The elements of statistical learning: data mining,
dle encrypted data. The data should be encrypted right from inference and prediction (2 ed.). Springer.
its source so that by the time it reaches the AI system it is http://www-stat.stanford.edu/~tibs/ElemStatLearn/
already unintelligible. The model can be then trained with this
encrypted data producing a trained model based on encrypted [9] Weizhe Hua, Zhiru Zhang, and G. Edward Suh. 2018.
data that is by concept secure against reverse engineering. The Reverse engineering convolutional neural networks
ability of homomorphic encryption to enable operations on through side-channel information leaks. In Proceedings
encrypted data allows this approach. The CKKS scheme for of the 55th Annual Design Automation Conference (DAC
the HE should be used as it is the algorithm that best suits ’18). Association for Computing Machinery, New York,
machine learning models. NY, USA, Article 4, 6 pages. DOI:
http://dx.doi.org/10.1145/3195970.3196105
Finally, the integrity of the model and data can be ensured by
the well-known approach of digital signing. These elements [10] Gareth James, Daniela Witten, Trevor Hastie, and
should be signed right after their generation using ECDSA as Robert Tibshirani. 2013. An Introduction to Statistical
it provides a high-security performance at low costs. Learning: with Applications in R. Springer.
https://faculty.marshall.usc.edu/gareth-james/ISL/
REFERENCES
[11] Andrey Kim, Antonis Papadimitriou, and Yuriy
[1] Yossi Adi, Carsten Baum, Moustapha Cisse, Benny
Polyakov. 2020. Approximate Homomorphic
Pinkas, and Joseph Keshet. 2018. Turning your
Encryption with Reduced Approximation Error.
weakness into a strength: watermarking deep neural
Cryptology ePrint Archive, Paper 2020/1118. (2020).
networks by backdooring. In Proceedings of the 27th
https://eprint.iacr.org/2020/1118
USENIX Conference on Security Symposium (SEC’18).
https://eprint.iacr.org/2020/1118.
USENIX Association, USA, 1615–1631.
[2] Giorgio Buttazzo. 2023. Rise of artificial general [12] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E.
intelligence: risks and opportunities. Frontiers in Hinton. 2012. ImageNet classification with deep
Artificial Intelligence 6 (2023). DOI: convolutional neural networks. In Proceedings of the
http://dx.doi.org/10.3389/frai.2023.1226990 25th International Conference on Neural Information
Processing Systems - Volume 1 (NIPS’12). Curran
[3] Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Associates Inc., Red Hook, NY, USA, 1097–1105.
Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell.
2014. DeCAF: a deep convolutional activation feature [13] Ning Lin, Xiaoming Chen, Hang Lu, and Xiaowei Li.
for generic visual recognition. In Proceedings of the 31st 2021. Chaotic Weights: A Novel Approach to Protect
International Conference on International Conference Intellectual Property of Deep Neural Networks. IEEE
on Machine Learning - Volume 32 (ICML’14). Transactions on Computer-Aided Design of Integrated
JMLR.org, I–647–I–655. Circuits and Systems 40, 7 (2021), 1327–1339. DOI:
[4] J. Fieres, Johannes Schemmel, and Kyle Meier. 2006. http://dx.doi.org/10.1109/TCAD.2020.3018403
Training convolutional networks of threshold neurons
Authorized licensed use limited to: Universidad Industrial de Santander. Downloaded on October 16,2024 at 04:12:01 UTC from IEEE Xplore. Restrictions apply.
2024 13th MEDITERRANEAN CONFERENCE ON EMBEDDED COMPUTING (MECO), 11-14 JUNE 2024, BUDVA, MONTENEGRO
[14] Xingcheng Luo, Ruihan Shen, Jian Hu, Jianhua Deng, International Conference on Big Data, Information and
Linji Hu, and Qing Guan. 2017. A Deep Convolution Computer Network (BDICN). 182–188. DOI:
Neural Network Model for Vehicle Recognition and http://dx.doi.org/10.1109/BDICN55575.2022.00043
Face Recognition. Procedia Comput. Sci. 107, C (apr
[21] Evgeny Smirnov, Denis Timoshenko, and Serge
2017), 715–720. DOI:
Andrianov. 2014. Comparison of Regularization
http://dx.doi.org/10.1016/j.procs.2017.03.153
Methods for ImageNet Classification with Deep
[15] Lara Mauri and Ernesto Damiani. 2022. Modeling Convolutional Neural Networks. AASRI Procedia 6 (12
Threats to AI-ML Systems Using STRIDE. Sensors 22, 2014), 89–94. DOI:
17 (2022). DOI:http://dx.doi.org/10.3390/s22176662 http://dx.doi.org/10.1016/j.aasri.2014.05.013
[16] Qahtan Makki Shallal Mohammad Ubaidullah Bokhari. [22] Christian Szegedy, Alexander Toshev, and Dumitru
2016. A Review on Symmetric Key Encryption Erhan. 2013. Deep Neural Networks for Object
Techniques in Cryptography. International Journal of Detection. In Advances in Neural Information
Computer Applications 147, 10 (Aug 2016), 43–48. Processing Systems, C.J. Burges, L. Bottou, M. Welling,
DOI:http://dx.doi.org/10.5120/ijca2016911203 Z. Ghahramani, and K.Q. Weinberger (Eds.), Vol. 26.
[17] Muhammad Faheem Mushtaq, Sapiee Jamel, Curran Associates, Inc.
https://proceedings.neurips.cc/paper_files/paper/
Abdulkadir Hassan Disina, Zahraddeen A. Pindar, Nur
2013/file/f7cade80b7cc92b991cf4d2806d6bd78-Paper.pdf
Shafinaz Ahmad Shakir, and Mustafa Mat Deris. 2017.
A Survey on the Cryptographic Encryption Algorithms. [23] Ayşegül Uçar. 2017. Deep Convolutional Neural
International Journal of Advanced Computer Science Networks for facial expression recognition. 371–375.
and Applications 8, 11 (2017). DOI: DOI:http://dx.doi.org/10.1109/INISTA.2017.8001188
http://dx.doi.org/10.14569/IJACSA.2017.081141
[24] Jichen Wang, Jun Lin, and Zhongfeng Wang. 2016.
[18] Michael A. Nielsen. 2018. Neural Networks and Deep Efficient convolution architectures for convolutional
Learning. (2018). neural network. In 2016 8th International Conference on
http://neuralnetworksanddeeplearning.com/ Wireless Communications Signal Processing (WCSP).
[19] Tara Sainath, Brian Kingsbury, Abdel-rahman 1–5. DOI:http://dx.doi.org/10.1109/WCSP.2016.7752726
Mohamed, George Dahl, George Saon, Hagen Soltau, [25] Matthew Zeiler and Rob Fergus. 2013. Stochastic
Tomas Beran, Aleksandr Aravkin, and Bhuvana Pooling for Regularization of Deep Convolutional
Ramabhadran. 2013. Improvements to Deep Neural Networks. In: ICLR (01 2013).
Convolutional Neural Networks for LVCSR. (09 2013).
DOI:http://dx.doi.org/10.1109/ASRU.2013.6707749 [26] Zhifei Zhang. 2016. Derivation of Backpropagation in
Convolutional Neural Network (CNN). (October 2016),
[20] Yuanbo Shang. 2022. Efficient and Secure Algorithm: 7. https://pdfs.semanticscholar.org/5d79/
The Application and Improvement of ECDSA. In 2022 11c93ddcb34cac088d99bd0cae9124e5dcd1.pdf
Authorized licensed use limited to: Universidad Industrial de Santander. Downloaded on October 16,2024 at 04:12:01 UTC from IEEE Xplore. Restrictions apply.