Next Article in Journal
Preface: Fifth International Conference on Advances in Mechanical Engineering 2025 (ICAME-25)
Previous Article in Journal
Shield-X: Vectorization and Machine Learning-Based Pipeline for Network Traffic Threat Detection
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

SMSProcessing Using Optical Character Recognition for Smishing Detection †

by
Lidia Prudente-Tixteco
*,
Jesus Olivares-Mercado
* and
Linda Karina Toscano-Medina
Escuela Superior de Ingeniería Mecánica y Eléctrica Unidad Culhuacan, Instituto Politecnico Nacional, Mexico City 04440, Mexico
*
Authors to whom correspondence should be addressed.
Presented at the First Summer School on Artificial Intelligence in Cybersecurity, Cancun, Mexico, 3–7 November 2025.
Eng. Proc. 2026, 123(1), 12; https://doi.org/10.3390/engproc2026123012
Published: 3 February 2026
(This article belongs to the Proceedings of First Summer School on Artificial Intelligence in Cybersecurity)

Abstract

Instant messaging services are the main modern means of communication because they allow the exchange of messages between people anywhere and through many types of devices. Smishing involves sending text messages spoofing banks, government institutions, or companies in order to deceive. These messages often include malicious links that redirect users to fraudulent websites designed to steal personal information and commit financial fraud, identity theft, and extortion, among other crimes. Detecting smishing requires techniques to prevent access to dynamic links generated by cybercriminals to take control of devices or to consult blacklists of malicious links. Optical Character Recognition (OCR) recognizes text embedded in images without accessing links. This paper presents a conceptual model that uses OCR to extract text from messages suspected of smishing from a screenshot of a mobile device so that further processing can analyze whether it is smishing.

1. Introduction

Different devices such as smartphones, tablets, and computers do tasks such as sending text messages, tracking online purchases, providing technical support, and sharing multimedia content, increasing their use in work and daily life. The rise of text messaging applications has generated new forms of cyberattacks against users in Mexico. Smishing is a type of phishing attack carried out through instant messaging services and SMS messages; its name comes from the combination of the terms “SMS” and “phishing”. This variant of phishing uses messages that appear to come from a trusted sender, such as banks or government institutions, and often include links to fraudulent websites and are sent from fake phone numbers. Smishing detection tools usually validate links on blacklists or reconstruct them using machine learning (ML) and natural language processing (NLP). However, these techniques carry the risk of accessing dynamic links and directing users to fake websites, increasing the risk that they will unknowingly interact with fraudulent links [1], and cybercriminals could take control of their devices [2]. In Mexico, around 90% of users use instant messaging as a communication channel [3] and are victims of smishing attacks to obtain personal information or money, mainly through text messages and social networks that spoof legitimate financial institutions. Until November 2024, 174 financial institutions had been affected by identity theft, demonstrating that smishing is a significant challenge. Cybercriminals can avoid traditional security filters by modifying the content of messages or embedding text into images, which is difficult to detect automatically [4]. OCR is a technology for extracting text from images into an editable digital format; it automates the process of converting text embedded in images into structured data that can be automatically analyzed or processed [5,6]. Blanco-Medina et al. [7] propose a strategy that combines OCR and image preprocessing techniques to extract URLs from suspicious messages. This study focuses on URL analysis rather than message analysis to identify potentially malicious links in screenshots by combining computer vision and text recognition.

2. Materials and Methods

OCR is based on sequential steps to extract text from an image [8] and can be used as part of a solution to detect smishing without accessing malicious links. Each OCR step has its own mathematical principles and image processing techniques, which are described below as a proof of concept for text recognition in smishing messages:
  • Conversion to grayscale. This reduces the complexity of the original image, preserving the luminance information and working with it instead of the three RGB color channels (red, green, and blue) using the following Equation (1) [9]:
    I ( x , y ) = 0.2989 R + 0.5870 G + 0.1140 B
  • Binarization. This is applied using a transfer function [10] to convert the image to black and white, as shown in Equation (2). For this process, a fixed threshold T is set for each pixel in the image.
    f ( x , y ) = { 255 , i f I ( x , y ) > T 0 , i f I ( x , y ) T
  • Morphological operations. This analyzes the shape and structure of objects in images using set theory, random functions, and lattice algebra to identify techniques such as dilation, erosion, opening, and closing [11].
  • Character recognition. Models based on neural networks can be used for character recognition. Tesseract’s OCR engine (v. 5.5.0.20241111) uses LSTM (Long Short-Term Memory) models to recognize entire lines of text using recurrent neural networks [12].

3. Results

The proof of concept for the text extraction process from an image uses OCR with the ‘pytesseract’ library based on Tesseract OCR in Python 3.10 [13], which allows the text to be transcribed for further analysis. The text extraction process diagram is shown in Figure 1 and each of the stages are described below.
  • Conversion to grayscale. The screenshot of the suspected smishing text message in Figure 2A is converted to grayscale, using the ‘cv2.cvtColor()’ function from the ‘OpenCV’ library, in order to reduce unnecessary information and work with a single channel for the binarization process (Figure 2B).
  • Background detection. Background detection. A fixed threshold is used in screenshots of messages with a light background because they have a high contrast between the text and the background, which facilitates the binarization process. In images with a dark background, the contrast is lower, so it is necessary to invert colors using the ‘cv2.bitwise_not()’ function. To identify whether a theme is light or dark, the average brightness of the image pixels is calculated with ‘np.mean()’ using the ‘NumPy’ library, and a threshold of 57 is set. If this threshold is exceeded, the background is identified as dark.
  • Binarization. When a dark background is detected, an adaptive threshold is applied with ‘cv2.adaptiveThreshold()’ to the inverted grayscale image to obtain a binarized image. If a light background is detected, a fixed threshold of 127 is applied to the grayscale image (Figure 2C) using the ‘cv2.threshold()’ function, and the binarized image is obtained (Figure 2D).
  • Extracting text from the binarized image. The function ‘pytesseract.image_to_string()’ is applied to the binarized image to extract visible text from the image and return it as a text string, as shown in Figure 3.
  • Sanitization of extracted text. The text extracted from the image is sanitized for further analysis. The text is converted to lowercase using ‘lower()’ and line breaks and extra spaces are removed using ‘replace()’ and ‘strip()’. The transcription of the text is shown in Figure 4.

4. Discussion

The text extracted from the image does not contain the link information that smishing messages often contain due to the image processing, which is lost during the binarization stage because of the characteristic blue color of links, and the proposal of this research is not affected. OCR can help detect smishing because it extracts the rest of the text in messages that can be analyzed based on keywords, in this case in Spanish.
Tests were performed with screenshots in light mode and dark mode, simulating the settings that a user’s mobile device might have, to determine the threshold and verify that character recognition is not affected by the loss of information from the suspected smishing message, and so far it has shown good qualitative results. Currently, tests are being conducted with an image database to determine the quantitative effectiveness of OCR.

5. Conclusions

Implementing OCR for smishing detection helps users to take a screenshot and ensure that they do not interact with the suspicious message, without the need to copy the message or link, thus avoiding the risk of being redirected to fake websites or executing malicious code on devices.
Sanitized text recovered from a screenshot of the suspicious smishing message requires additional techniques to complement the smishing detection phase, such as machine learning or natural language processing techniques that help contextualize the message received in Spanish.

Author Contributions

L.P.-T., J.O.-M. and L.K.T.-M. contributed equally to the conception, writing, and review of the manuscript. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The raw data supporting the conclusions of this article will be made available by the authors on request.

Conflicts of Interest

The author declares no conflict of interest.

References

  1. Klaviyo. Campaign SMS and MMS Benchmarks. 2024. Available online: https://help.klaviyo.com/hc/en-us/articles/360051110111 (accessed on 25 September 2024).
  2. Martínez Santander, C.J.; Cruz Gavilanes, Y.N.; Cruz Gavilanes, T.M.; Álvarez Lozano, M.I. Layered security to stop smishing attacks. Dominio Las Cienc. 2018, 4, 115–130. [Google Scholar]
  3. Statista. Mexico: Percentage of Users by Social Network 2023. 2024. Available online: https://es.statista.com/estadisticas/1035031/mexico-porcentaje-de-usuarios-por-red-social/ (accessed on 25 September 2024).
  4. National Commission for the Protection and Defense of Financial Services Users (CONDUSEF). Impersonating Financial Institutions to Commit Fraud. 2024. Available online: https://www.condusef.gob.mx/?p=contenido&idc=2534&idcat=1 (accessed on 25 September 2024).
  5. Fernández, S.; Javier, C.; Consuegra, V.S. Optical character recognition (OCR). Univ. Carlo 2008, 3, 2008. [Google Scholar]
  6. Rajmod, V.; Derkar, G.; Nagrale, P.; Awari, N.; Lokhande, M.P. Text Extraction from Image Using OCR. In Proceedings of the 2025 6th International Conference on Mobile Computing and Sustainable Informatics (ICMCSI), Goathgaun, Nepal, 7–8 January 2025; pp. 113–116. [Google Scholar] [CrossRef]
  7. Medina, P.B.; Carofilis, A.; Fidalgo, E.; Alegre, E. Image preprocessing and OCR to improve smishing detection (Preprocesado de imagen y OCR para mejorar deteccion de smishing). Jorn. AutomáTica 2024, 45, 10955. (In Spanish) [Google Scholar] [CrossRef]
  8. Busa, R.; Shahira, K.C.; Lijiya, A. Small Text Extraction from Documents and Chart Images. In Proceedings of the 2022 IEEE 19th India Council International Conference (INDICON), Kochi, India, 24–26 November 2022; pp. 1–5. [Google Scholar] [CrossRef]
  9. Gonzalez, R.C.; Woods, R.E. Digital Image Processing, 3rd ed.; Prentice Hall: Hoboken, NJ, USA, 2008. [Google Scholar]
  10. Sezgin, M.; Sankur, B. Survey over image thresholding techniques and quantitative performance evaluation. J. Electron. Imaging 2004, 13, 146–165. [Google Scholar] [CrossRef]
  11. Serra, J. Image Analysis and Mathematical Morphology; Academic Press: Cambridge, MA, USA, 1982. [Google Scholar]
  12. Smith, R. An overview of the Tesseract OCR engine. In Proceedings of the International Conference on Document Analysis and Recognition (ICDAR), Curitiba, Brazil, 23–26 September 2007; Volume 2, pp. 629–633. [Google Scholar]
  13. Archana, D.; Deepak, K.; Lokesh, D.K.S.; Sridharan, S.N.; Vasanth, G.; Sriram, N.S.; Prawin, B.K.S. Image Text Detection and Documentation Using OCR. In Proceedings of the 2024 International Conference on Smart Systems for Electrical, Electronics, Communication and Computer Engineering (ICSSEECC), Coimbatore, India, 28–29 June 2024; pp. 410–414. [Google Scholar] [CrossRef]
Figure 1. Optical character recognition process for messages suspected of being smishing.
Figure 1. Optical character recognition process for messages suspected of being smishing.
Engproc 123 00012 g001
Figure 2. Text extraction process from an screenshot (AD).
Figure 2. Text extraction process from an screenshot (AD).
Engproc 123 00012 g002
Figure 3. Text extracted from the screenshot.
Figure 3. Text extracted from the screenshot.
Engproc 123 00012 g003
Figure 4. Post-processed text extracted from the capture.
Figure 4. Post-processed text extracted from the capture.
Engproc 123 00012 g004
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Prudente-Tixteco, L.; Olivares-Mercado, J.; Toscano-Medina, L.K. SMSProcessing Using Optical Character Recognition for Smishing Detection. Eng. Proc. 2026, 123, 12. https://doi.org/10.3390/engproc2026123012

AMA Style

Prudente-Tixteco L, Olivares-Mercado J, Toscano-Medina LK. SMSProcessing Using Optical Character Recognition for Smishing Detection. Engineering Proceedings. 2026; 123(1):12. https://doi.org/10.3390/engproc2026123012

Chicago/Turabian Style

Prudente-Tixteco, Lidia, Jesus Olivares-Mercado, and Linda Karina Toscano-Medina. 2026. "SMSProcessing Using Optical Character Recognition for Smishing Detection" Engineering Proceedings 123, no. 1: 12. https://doi.org/10.3390/engproc2026123012

APA Style

Prudente-Tixteco, L., Olivares-Mercado, J., & Toscano-Medina, L. K. (2026). SMSProcessing Using Optical Character Recognition for Smishing Detection. Engineering Proceedings, 123(1), 12. https://doi.org/10.3390/engproc2026123012

Article Metrics

Back to TopTop