Abstract
To break a ciphertext, as a first step, it is essential to identify the cipher used to produce the ciphertext. Cryptanalysis has acquired deep knowledge on cryptographic weaknesses of classical ciphers, and modern ciphers have been designed to circumvent these weaknesses. The American Cryptogram Association (ACA) standardized so-called classical ciphers, which had historical relevance up to World War II. Identifying these cipher types using machine learning has shown promising results, but the state of the art relies on engineered features based on cryptanalysis. To overcome this dependency on domain knowledge, we explore in this paper the applicability of the two feature-learning algorithms long short-term memory (LSTM) and Transformer, for 55 classical cipher types from ACA. To lower the necessary data and the training time, various transfer-learning scenarios are investigated. Over a dataset of 10 million ciphertexts with a text length of 100 characters, Transformer correctly identified 72.33% of the ciphers, which is a slightly worse result than the best feature-engineering approach. Furthermore, with an ensemble model of feature-engineering and feature-learning neural network types, 82.78% accuracy over the same dataset has been achieved, which is the best known result for this significant problem in the field of cryptanalysis.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Sklearn Library: https://scikit-learn.org/stable/.
- 2.
- 3.
- 4.
Keras: https://keras.io/.
- 5.
Sklearn: https://scikit-learn.org/stable/.
References
Abd, A., Al-Janabi, S.: Classification and identification of classical cipher type using artificial neural networks. J. Eng. Appl. Sci. 14, 3549–3556 (2019)
American Cryptogram Association: Cryptogram (2005). https://www.cryptogram.org/. Visited 14 April 2021
Beaulieu, R., Shors, D., Smith, J., Treatman-Clark, S., Weeks, B., Wingers, L.: The SIMON and SPECK lightweight block ciphers. In: Proceedings of the 52nd Annual Design Automation Conference, pp. 1–6. Association for Computing Machinery, San Francisco California, June 2015
Brownlee, J.: Why use ensemble learning? October 2020. https://machinelearningmastery.com/why-use-ensemble-learning/. Visited 14 April 2021
Gohr, Aron: Improving attacks on round-reduced Speck32/64 using deep learning. In: Boldyreva, Alexandra, Micciancio, Daniele (eds.) CRYPTO 2019. LNCS, vol. 11693, pp. 150–179. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-26951-7_6
Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural Comput. 9, 1735–1780 (1997)
Katz, J., Lindell, Y.: Introduction to Modern Cryptography. CRC Press, Boca Raton (2020)
Kemker, R., McClure, M., Abitino, A., Hayes, T., Kanan, C.: Measuring catastrophic forgetting in neural networks. 54 Lomb Memorial Drive, Rochester NY 14623, November 2017. arXiv:1708.02072
Kopal, N.: Of ciphers and neurons-detecting the type of ciphers using artificial neural networks. In: Proceedings of the 3rd International Conference on Historical Cryptology HistoCrypt 2020, pp. 77–86. No. 171, Linköping University Electronic Press (2020)
Krishna, N.: Classifying Classic Ciphers using Machine Learning. Master’s thesis, San Jose State University, California, USA, May 2019
Lau, S.: Learning rate schedules and adaptive learning rate methods for deep learning, December 2020. https://towardsdatascience.com/learning-rate-schedules-and-adaptive-learning-rate-methods-for-deep-learning-2c8f433990d1. Visited 14 April 2021
Leierzopf, E.: NCID - Neural Cipher Identifier (2021). https://github.com/dITySoftware/ncid
Leierzopf, E., Kopal, N., Esslinger, B., Lampesberger, H., Hermann, E.: A massive machine-learning approach for classical cipher type detection using feature engineering. In: HistoCrypt (accepted) (2021)
Megyesi, B., Blomqvist, N., Pettersson, E.: The DECODE database: collection of historical ciphers and keys. In: In Proceedings of the 2nd International Conference on Historical Cryptology, HistoCrypt 2019, pp. 69–78. Linköping Electronic Press, Mons, Belgium, June 2019
Megyesi, B., et al.: Decryption of historical manuscripts: the DECRYPT project. Cryptologia pp. 1–15 (2020). https://doi.org/10.1080/01611194.2020.1716410
Nandan, A.: Text classification with transformer, May 2020. https://keras.io/examples/nlp/text_classification_with_transformer/
Nuhn, M., Knight, K.: Cipher type detection. In: Conference on Empirical Methods In Natural Language Processing, pp. 1769–1773. Doha, Quatar, October 2014
Sivagurunathan, G., Rajendran, V., Purusothaman, T.: Classification of substitution ciphers using neural networks. IJCSNS Int. J. Comput. Sci. Network Secur. 10, 274–279 (2010)
Vaswani, A., et al.: Attention is all you need. In: 31st Conference on Neural Information Processing Systems, Long Beach, CA, USA (2017)
Acknowledgements
This work has been supported by the Swedish Research Council (grant 2018–06074, DECRYPT – Decryption of historical manuscripts) and the University of Sciences Upper Austria for providing access to the Nvidia DGX-1 deep learning machine.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Singapore Pte Ltd.
About this paper
Cite this paper
Leierzopf, E., Mikhalev, V., Kopal, N., Esslinger, B., Lampesberger, H., Hermann, E. (2021). Detection of Classical Cipher Types with Feature-Learning Approaches. In: Xu, Y., et al. Data Mining. AusDM 2021. Communications in Computer and Information Science, vol 1504. Springer, Singapore. https://doi.org/10.1007/978-981-16-8531-6_11
Download citation
DOI: https://doi.org/10.1007/978-981-16-8531-6_11
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-16-8530-9
Online ISBN: 978-981-16-8531-6
eBook Packages: Computer ScienceComputer Science (R0)