Efficient Detection of XSS and DDoS Attacks with Bent Functions
Abstract
1. Introduction
- A. Main Challenges and Motivation:
- B. Contribution:
- Preprocessing DDoS and XSS data with the Maiorana–McFarland Bent function to amplify the non-linearity of features and representations and complement cyber-attack detection.
- Building a repeatable methodological scheme for applying Bent function transformations to network traffic data, enhancing feature discrimination and model interpretability.
- Decreasing overfitting based on the Bent function transformation, enhancing learning precision and the quality of clustering data, and providing data with an efficient mapping to a higher-dimensional space.
- Increasing the realization of substantial performance improvements with both supervised and unsupervised learning models with higher cluster separability and lower computational costs.
- Creating a method that demonstrates how Bent function transformations improve important network features for intrusion detection and can serve as a foundation for future systems.
- C. Paper structure:
2. Related Work on XSS and DDoS Attacks
2.1. Cross-Site Scripting (XSS) Attack Detection
2.2. Distributed Denial of Service (DDoS) Attack Detection
3. XSS and DDoS Detection with Bent Functions
3.1. Preliminaries and Background of Bent Functions
3.1.1. Theoretical Foundations of Bent Functions
3.1.2. Construction of Bent Functions
- A. Maiorana- McFarland (M-M):
- B. Dillon’s Partial Spread–Class:
- C. Iterative construction:
4. Experimental Results and Discussion
4.1. Research Approach
4.2. Tools and Datasets
4.2.1. Tools
- Jupyter Notebook 6.5.7 (Python) was used for both data manipulation and implementing the Bent function, leveraging many libraries Python 3.13.3 provides for data processing and machine learning. It exports to either CSV or ARFF format, compatible with WEKA.
- WEKA GUI 3.8.9 was used to implement machine learning algorithms, visualize clustering patterns, and train and test data with those algorithms. The training-testing ratio can be adjusted from the default of 66–34%. Its interactive interface helps tune parameters and visualize data. The filter slider in the Weka Explorer interface is indicated by the green circle in Figure 2. Users can apply an unsupervised instance resampling technique to visually displayed DDoS test data using the filter slider.
4.2.2. Datasets Preparation
4.2.3. Feature Extraction and Selection
4.3. Execution of the Maiorana–McFarland Bent Function
- x: A single binary attribute selected from the network data.
- y: The remaining binary attributes in the network data.
- : A fixed permutation applied to the y attributes.
- : An arbitrary Boolean function of the y attributes.
- Transformation of Data
- Permutation :
- Arbitrary Mapping (h(y))
- Transformation: This value h was then multiplied by an identity matrix and added to the M-M function.
- Dataset Expansion: This process creates 21 new datasets from each original dataset, each with 20 columns.
- Mapping Insight: In the figure below, we see how cost and balanced mappings can be applied to up to 7 variables, which are essential for constructing .
4.4. Machine Learning Evaluation of Bent Functions
4.4.1. Supervised Learning Results
- Accuracy of classification after applying the bent function:
- A. For the DDOS attack data—Decision Tree:

- B. For the DDOS attack data—Random Forest:

- C. For the XSS attack—Decision Tree:

- D. For the XSS attack—Random Forest:

4.4.2. Unsupervised Learning Results
4.5. Discussion
5. Conclusions and Future Work
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Sriranjani, R.; Saleem, M.D.; Hemavathi, N.; Parvathy, A. A Machine Learning Based Intrusion Detection Scheme to Detect Replay Attacks in the Smart Grid. In Proceedings of the 2023 IEEE International Students’ Conference on Electrical, Electronics, and Computer Science (SCEECS), Bhopal, India, 18–19 February 2023; pp. 1–5. [Google Scholar] [CrossRef]
- Liu, W.; Zhao, Q.; Zhang, Q. Construction of Vectorial Boolean Functions with Provable Differential-Linear Uniformity and High Nonlinearity. In Proceedings of the 2024 6th International Conference on Natural Language Processing (ICNLP), Hangzhou, China, 22–24 March 2024; pp. 300–304. Available online: https://ieeexplore.ieee.org/document/10692619 (accessed on 1 November 2025).
- Ni, T.; Lan, G.; Wang, J.; Zhao, Q.; Xu, W. Eavesdropping Mobile App Activity via Radio-Frequency Energy Harvesting. In Proceedings of the 32nd USENIX Security Symposium 2023, Anaheim, CA, USA, 9–11 August 2023; pp. 3511–3528. Available online: https://www.usenix.org/conference/usenixsecurity23/presentation/ni (accessed on 20 December 2025).
- Li, J.; Wu, S.; Zhou, H.; Luo, X.; Wang, T.; Liu, Y.; Ma, X. Packet-Level Open-World App Fingerprinting on Wireless Traffic. In Proceedings of the 2022 Network and Distributed System Security Symposium (NDSS’22), San Diego, CA, USA, 24–28 April 2022; pp. 1–12. Available online: https://www.ndss-symposium.org/ndss-paper/auto-draft-218/ (accessed on 21 December 2025).
- Li, J.; Zhou, H.; Wu, S.; Luo, X.; Wang, T.; Zhan, X.; Ma, X. FOAP: Fine-Grained Open-World Android App Fingerprinting. In Proceedings of the 31st USENIX Security Symposium (USENIX Security 22), Boston, MA, USA, 10–12 August 2022; pp. 1579–1596. Available online: https://www.usenix.org/conference/usenixsecurity22/presentation/li-jianfeng (accessed on 22 December 2025).
- Kumar, J.H.; Ponsam, J.G. Cross Site Scripting (XSS) Vulnerability Detection Using Machine Learning and Statistical Analysis. In Proceedings of the 2023 International Conference on Computer Communication and Informatics (ICCCI), Coimbatore, India, 23–25 January 2023; pp. 1–9. [Google Scholar] [CrossRef]
- Nilavarasan, G.; Balachander, T. XSS Attack Detection Using Convolution Neural Network. In Proceedings of the 2023 International Conference on Artificial Intelligence and Knowledge Discovery in Concurrent Engineering (ICECONF), Chennai, India, 5–7 January 2023; pp. 1–6. [Google Scholar] [CrossRef]
- Lu, D.; Liu, L. Research on Cross-site Scripting Attack Detection Technology Based on Few-shot Learning. In Proceedings of the 2023 IEEE 6th Information Technology, Networking, Electronic and Automation Control Conference (ITNEC), Chongqing, China, 24–26 February 2023; pp. 1425–1429. [Google Scholar] [CrossRef]
- Sethi, M.; Verma, J.; Snehi, M.; Baggan, V.; Virender; Chhabra, G. Web Server Security Solution for Detecting Cross-site Scripting Attacks in Real-time Using Deep Learning. In Proceedings of the 2023 International Conference on Artificial Intelligence and Applications (ICAIA) Alliance Technology Conference (ATCON-1), Noida, India, 21–22 April 2023; pp. 1–5. [Google Scholar] [CrossRef]
- Hamzah, K.H.; Osman, M.Z.; Anthony, T.; Ismail, M.A.; Abdullah, Z.; Alanda, A. Comparative Analysis of Machine Learning Algorithms for Cross-Site Scripting (XSS) Attack Detection. JOIV Int. J. Inform. Vis. 2024, 8, 1678–1685. Available online: https://joiv.org/index.php/joiv/article/view/3451 (accessed on 4 January 2026). [CrossRef]
- Oshoiribhor, E.O.; John-Otumu, A.M. XSS-Net: An Intelligent Machine Learning Model for Detecting Cross-Site Scripting (XSS) Attack in Web Application. Mach. Learn. Res. 2025, 10, 14–24. [Google Scholar] [CrossRef]
- Alhamyani, R.; Alshammari, M. Machine Learning-Driven Detection of Cross-Site Scripting Attacks. Information 2024, 15, 420. [Google Scholar] [CrossRef]
- Bakır, R.; Bakır, H. Swift Detection of XSS Attacks: Enhancing XSS Attack Detection by Leveraging Hybrid Semantic Embeddings and AI Techniques. Arab. J. Sci. Eng. 2025, 50, 1191–1207. [Google Scholar] [CrossRef]
- Ahmim, A.; Maazouzi, F.; Ahmim, M.; Namane, S.; Dhaou, I.B. Distributed Denial of Service Attack Detection for the Internet of Things Using Hybrid Deep Learning Model. IEEE Access 2023, 11, 119862–119875. [Google Scholar] [CrossRef]
- Prathap, P.; Duttagupta, S. AI-Enabled Fast Detection of DDoS and Adversary DDoS Attacks in SDN. In Proceedings of the 2023 14th International Conference on Computing Communication and Networking Technologies (ICCCNT), IIT Delhi, New Delhi, India, 6–8 July 2023; pp. 1–7. [Google Scholar] [CrossRef]
- Kamaldeep; Malik, M.; Dutta, M. Feature Engineering and Machine Learning Framework for DDoS Attack Detection in the Standardized Internet of Things. IEEE Internet Things J. 2023, 10, 8658–8669. [Google Scholar] [CrossRef]
- Haque, S.; El-Moussa, F.; Komninos, N.; Muttukrishnan, R. Identification of Important Features at Different IoT Layers for Dynamic Attack Detection. In Proceedings of the 2023 IEEE 9th International Conference on Big Data Security on Cloud (BigDataSecurity), IEEE International Conference on High Performance and Smart Computing (HPSC), and IEEE International Conference on Intelligent Data and Security (IDS), Laguna Hills, CA, USA, 6–8 May 2023; pp. 84–90. [Google Scholar] [CrossRef]
- Dantas, C.; Pessoa, P.; Ferreira, J.; Maciel, P.; Dantas, J. DDoS Detection Based on Hardware Performance Counters Selection. In Proceedings of the 2023 IEEE International Conference on Enabling Technologies: Infrastructure for Collaborative Enterprises (WETICE), Biarritz, France, 14–16 December 2023; pp. 1–6. [Google Scholar] [CrossRef]
- Lamptey, R.; Saedi, M.; Stankovic, V. Machine-Learning Anomaly Detection for Early Identification of DDoS in Smart Home IoT Devices. In Proceedings of the 2025 IEEE International Conference on Cyber Security and Resilience (CSR), Venice, Italy, 4–6 August 2025; pp. 105–110. [Google Scholar] [CrossRef]
- Kachavimath, A.V.; Narayan, D. An Efficient DDoS Attack Detection in SDN Using Multi-Feature Selection and Ensemble Learning. Procedia Comput. Sci. 2025, 252, 241–250. [Google Scholar] [CrossRef]
- Alnajim, A.M.; Alotaibi, F.M.; Khan, S. Detecting and Mitigating Distributed Denial of Service Attacks in Software-Defined Networking. Comput. Mater. Contin. 2025, 83, 4515–4535. [Google Scholar] [CrossRef]
- Xu, Z. Deep Learning Based DDoS Attack Detection. ITM Web Conf. 2025, 70, 03005. [Google Scholar] [CrossRef]
- Li, Y.; Kan, H.; Mesnager, S.; Peng, J.; Zheng, L. Direct Approaches for Generic Constructions of Plateaued Functions and Bent Functions Outside M#. IEEE Trans. Inf. Theory 2025, 71, 1400–1418. [Google Scholar] [CrossRef]
- Kudin, S.; Pasalic, E.; Polujan, A.; Zhang, F.; Zhao, H. Almost Maiorana-McFarland Bent Functions. IEEE Trans. Inf. Theory 2025, 71, 9698–9713. [Google Scholar] [CrossRef]
- Anbar, N.; Kudin, S.; Meidl, W.; Pasalic, E.; Polujan, A. Vectorial Negabent Concepts: Similarities, Differences, and Generalizations. Des. Codes Cryptogr. 2025, 93, 899–921. [Google Scholar] [CrossRef]
- Kim, S.; Shin, M.; Kim, S.; Shin, H.; Kim, I.; Kwon, D.; Lee, D.; Kim, S.; Hong, D.; Sung, J.; et al. Redefining Security in Shadow Cipher for IoT Nodes: New Full-Round Practical Distinguisher and the Infeasibility of Key-Recovery Attacks. IEEE Internet Things J. 2025, 12, 6805–6817. [Google Scholar] [CrossRef]
- Çeşmelioğlu, A.; Meidl, W. Construction and Equivalence for Generalized Boolean Functions. Cryptogr. Commun. 2025, 17, 1659–1682. [Google Scholar] [CrossRef] [PubMed]
- Li, K.; Li, C.; Helleseth, T.; Qu, L. Further Investigations on Permutation Based Constructions of Bent Functions. J. Comb. Theory, Ser. A 2023, 199, 105779. [Google Scholar] [CrossRef]
- Cardell, S.D.; Fuúter-Sabater, A.; Requena, V.; Beltrá, M. A New Representation of Binary Sequences by Means of Boolean Functions. arXiv 2025, arXiv:2506.05374. [Google Scholar] [CrossRef]
- Prévost, T.; Martin, B. Testing a Cellular Automata Construction Method to Obtain 9-Variable Cryptographic Boolean Functions. arXiv 2025, arXiv:2501.09380. [Google Scholar] [CrossRef]
- Pasalic, E.; Polujan, A.; Kudin, S.; Zhang, F. Design and Analysis of Bent Functions Using M-Subspaces. IEEE Trans. Inf. Theory 2024, 70, 4464–4477. [Google Scholar] [CrossRef]
- Polujan, A.; Mariot, L.; Picek, S. On Two Open Problems on the Normality of Bent Functions. Discret. Appl. Math. 2025, 360, 115–118. [Google Scholar] [CrossRef]
- Polujan, A.; Pasalic, E.; Kudin, S.; Zhang, F. Bent Functions Satisfying the Dual Bent Condition and Permutations with the (Am) Property. Cryptogr. Commun. 2024, 16, 1235–1256. [Google Scholar] [CrossRef]










| Dataset | Labels | Size (Rows × Columns) | Primary Use |
|---|---|---|---|
| D1-DDoS, labelled | Yes | 2059 × 22 | Supervised Decision Tree |
| D2-DDoS, unlabelled | No | 2059 × 21 | K-Means clustering |
| D3-XSS, labelled | Yes | 1800 × 22 | Supervised Random Forest |
| D4-XSS, unlabelled | No | 1800 × 21 | Unsupervised clustering |
| Attribute | Variable | Description |
|---|---|---|
| download | X1 | Related to the indicator for data downloads. |
| srcport | X2 | The source port is a well-known port used for identifying and verifying port availability. |
| dstport | X3 | This is the information about the destination port. |
| dnsEnquiries | X4 | Request data from the DNS server. |
| dnsAnswers | X5 | This is how a DNS server provides a response from its database. |
| ipAddressConnectTCP | X6 | Connected to the TCP/IP communication protocol. |
| ipAddressConnectICMP | X7 | The transmission of operational information to an IP address is associated with the Internet Control Message protocol. |
| pshAck | X8 | It is required that the pushed buffered data is acknowledged. |
| noGet | X9 | Access the GET request to filter web traffic. |
| noPost | X10 | A part of the POST request. |
| noSYN | X11 | Related to the byte sequence number of the of transmitted data. |
| requestContent | X12 | An API that facilitates object creation. |
| postSize | X13 | Concerned with the size of the POST method request. |
| ipBlackList | X14 | Blacklisted IP address. |
| maliciousDNSIPConnect | X15 | The malicious interference of a user’s web browsing capability is responsible for this. |
| protocolTypeMal | X16 | A protocol for detecting malicious hosts. |
| tcpFin | X17 | The protocol indicated that the connection had ended. |
| packetLength | X18 | This is the number of bytes that divide the current and next packets. |
| tcpAck | X19 | The TCP protocol involves recording the last seen, sequence number of packets, expected sequence number, and Acknowledgement number. |
| analyseXSS | X20 | Investigate the indicators of XSS. |
| analyseSQL | X21 | Investigate the indicators in SQL. |
| Model | Dataset | Accuracy (pre-Bent) | Accuracy (post-Bent) |
|---|---|---|---|
| Dataset | D1 (DDoS With Label) | 100% (1.0) (Correctly classified 700 out of 700 instances) | Varies, up to 100% (1.0) (Retains maximum accuracy when consolidated with X18 or X19 attributes) |
| Random Forest | D3 (XSS with label) | 100% (1.0) (Perfect classification and overfitting data) | 87.19% (Consolidated attributes X2 or X4 achieved 0.871891) |
| Algorithm | Dataset | Metric | Original Data (Pre-Bent) | New Data (Post-Bent) |
|---|---|---|---|---|
| K-Means (K = 2) | D2 (DDoS unlabelled) | Accuracy | 99.85% | 99.92% (Observed for important features) |
| K-Means (K = 2) | D2 (DDoS unlabelled) | F1 Score | 0.9989 | 0.9991 |
| K-Means (K = 2) | D2 (DDoS unlabelled) | MSE | 0.0003 | 0.0000 |
| K-Means (K = 2) | D4 (XSS unlabelled) | Accuracy | 98.94% (Observed initial accuracy) | 100% (Observed optimized accuracy) |
| Hierarchical (Agglomerative) | D4 (XSS unlabelled) | Accuracy | 99.84% | N/A |
| Hierarchical (Agglomerative) | D4 (XSS unlabelled) | F1 Score | 0.9969 | 0.9969 |
| Hierarchical (Agglomerative) | D4 (XSS unlabelled) | MSE | 0.0000 | 0.0016 |
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. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Miri Kelaniki, S.; Komninos, N. Efficient Detection of XSS and DDoS Attacks with Bent Functions. Information 2026, 17, 80. https://doi.org/10.3390/info17010080
Miri Kelaniki S, Komninos N. Efficient Detection of XSS and DDoS Attacks with Bent Functions. Information. 2026; 17(1):80. https://doi.org/10.3390/info17010080
Chicago/Turabian StyleMiri Kelaniki, Shahram, and Nikos Komninos. 2026. "Efficient Detection of XSS and DDoS Attacks with Bent Functions" Information 17, no. 1: 80. https://doi.org/10.3390/info17010080
APA StyleMiri Kelaniki, S., & Komninos, N. (2026). Efficient Detection of XSS and DDoS Attacks with Bent Functions. Information, 17(1), 80. https://doi.org/10.3390/info17010080

