Entropy Analysis of Cryptographic Keys Using Machine Learning

Authors

  • Zamen Abood Ramadaan Department of Computer, College of Education for Pure Sciences, Wasit University, IRAQ

DOI:

https://doi.org/10.31185/wjps.1121

Keywords:

Keywords: Cryptographic Key Strength, Entropy Analysis, Machine Learning, Random Forest, K-Nearest Neighbors, Shannon Entropy, Statistical Features, Key Classification

Abstract

The strength of cryptography key is the basic ingredient of safe information systems, and it directs the strength of encryption algorithms towards attacks. Evaluation methods that rely on entropy measures alone, e.g. Shannon entropy or min-entropy, show any signs of subtle structure patterns or biases in weak keys. In this paper, a machine learning-based framework of a thorough analysis and classification of cryptographic keys are proposed. The model combines entropy values with statistical characteristics-such as variance, runs, autocorrelation-as well as assessment of various supervised learning models, such as Logistic Regression, K-Nearest Neighbors (KNN), Support Vector machines (SVM) and Random Forest classifier. Experiments performed on a synthetic dataset of 10,000 keys (128-bits and 256 bits) indicate that ensemble-based models especially Random Forest have better accuracy of more than 99 percent, demonstrate stability in a noisy environment as well as generalization between various sizes of keys. Further tests, such as ablation tests, cross-validation sensibility tests, and tests of importance of features prove the paramount importance of integrating entropy and statistical features in order to do successful key classification. The offered solution has been suggested as a scalable, automated, and trustworthy method of cryptographic key strength analysis, and its possible usage is related to security-sensitive systems and mechanisms of key generators.

References

[1] Mukherjee, Pratyusa, et al. "Best fit DNA-based cryptographic keys: the genetic algorithm approach." Sensors 22.19 (2022): 7332.‏ DOI: 10.3390/s22197332 DOI: https://doi.org/10.3390/s22197332

[2] Salami, Yashar, Vahid Khajevand, and Esmaeil Zeinali. "Cryptographic algorithms: a review of the literature, weaknesses and open challenges." J. Comput. Robot 16.2 (2023): 46-56.‏ DOI: 10.22094/JCR.2023.1983496.1298

[3] Saini, Abhishek, and Ruchi Sehrawat. "Enhancing data security through machine learning-based key generation and encryption." Engineering, Technology & Applied Science Research 14.3 (2024): 14148-14154.‏ DOI: 10.48084/etasr.7181 DOI: https://doi.org/10.48084/etasr.7181

[4] Radanliev, Petar. "Cyber-attacks on Public Key Cryptography." (2023).‏ DOI: 10.20944/preprints202309.1769.v1 DOI: https://doi.org/10.20944/preprints202309.1769.v1

[5] Zolfaghari, Behrouz, Khodakhast Bibak, and Takeshi Koshiba. "The odyssey of entropy: Cryptography." Entropy 24.2 (2022): 266.‏ DOI: 10.3390/e24020266 DOI: https://doi.org/10.3390/e24020266

[6] Gao, Dongjie. "Gene sequence analysis model construction based on k-mer statistics." PloS one 19.9 (2024): e0306480.‏ DOI: 10.1371/journal.pone.0306480 DOI: https://doi.org/10.1371/journal.pone.0306480

[7] Bikos, Anastasios, et al. "Random number generators: Principles and applications." Cryptography 7.4 (2023): 54. DOI: 10.3390/cryptography7040054‏ DOI: https://doi.org/10.3390/cryptography7040054

[8] Anees, Amir, et al. "Machine learning and applied cryptography." Security & Communication Networks (2022).‏ DOI: 10.1155/2022/7009002 DOI: https://doi.org/10.1155/2022/9797604

[9] Roy, Pritam. "Enhancing Real-World Robustness in AI: Challenges and Solutions." J. Recent Trends Comput. Sci. Eng 12.1 (2024): 34-49.‏ DOI: 10.70589/JRTCSE.2024.1.6 DOI: https://doi.org/10.70589/JRTCSE.2024.1.6

[10] Blanco-Romero J, Lorenzo V, Almenares Mendoza F, Díaz-Sánchez D. Machine Learning Predictors for Min-Entropy Estimation. Entropy (Basel). 2025 Feb 2;27(2):156. doi: 10.3390/e27020156. PMID: 40003153; PMCID: PMC11854237. DOI: 10.3390/e27020156

[11] Guo, X.; Zhou, W.; Luo, Y.; Meng, X.; Li, J.; Bian, Y.; Guo, Y.; Xiao, L. Deep Learning-Based Min-Entropy-Accelerated Evaluation for High-Speed Quantum Random Number Generation. Entropy 2025, 27, 786. https://doi.org/10.3390/e27080786.DOI: 10.3390/e27080786 DOI: https://doi.org/10.3390/e27080786

[12] Kim, H.; Lim, S.; Kang, Y.; Kim, W.; Kim, D.; Yoon, S.; Seo, H. Deep-Learning-Based Cryptanalysis of Lightweight Block Ciphers Revisited. Entropy 2023, 25, 986. https://doi.org/10.3390/e25070986. DOI: 10.3390/e25070986 DOI: https://doi.org/10.3390/e25070986

[13] Monteiro V (2024) The Importance of Entropy Sources in Cryptography Randomness to Secure Communications. J Inform Tech Softw Eng. 14:393. DOI: 10.35248/2165-7866.24.14.393

[14] Ali, Aqib, Sania Anam, and Muhammad Munawar Ahmed. "Shannon entropy in artificial intelligence and its applications based on information theory." J. Appl. Emerg. Sci 13.1 (2023): 9-17. DOI: 10.36785/JAES.131549‏

[15] Blanco-Romero, Javier, et al. "Machine learning predictors for min-entropy estimation." Entropy 27.2 (2025): 156.‏ DOI: 10.3390/e27020156 DOI: https://doi.org/10.3390/e27020156

[16] Obi, Jude Chukwura. "A comparative study of several classification metrics and their performances on data." World Journal of Advanced Engineering Technology and Sciences 8.1 (2023): 308-314.‏ DOI: 10.30574/wjaets.2023.8.1.0046 DOI: https://doi.org/10.30574/wjaets.2023.8.1.0054

[17] St-Aubin, Philippe, and Bruno Agard. "Precision and reliability of forecasts performance metrics." Forecasting 4.4 (2022): 882-903. DOI: 10.3390/forecast4040048‏ DOI: https://doi.org/10.3390/forecast4040048

Downloads

Published

2026-06-30

Issue

Section

Computer

How to Cite

Abood Ramadaan, Z. (2026). Entropy Analysis of Cryptographic Keys Using Machine Learning. Wasit Journal for Pure Sciences, 5(2), 44-58. https://doi.org/10.31185/wjps.1121