Skip to main content

Detection of Classical Cipher Types with Feature-Learning Approaches

  • Conference paper
  • First Online:
Data Mining (AusDM 2021)

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 1504))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 64.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 84.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Sklearn Library: https://scikit-learn.org/stable/.

  2. 2.

    https://www.cryptool.org/ncid.

  3. 3.

    https://www.gutenberg.org/.

  4. 4.

    Keras: https://keras.io/.

  5. 5.

    Sklearn: https://scikit-learn.org/stable/.

References

  1. Abd, A., Al-Janabi, S.: Classification and identification of classical cipher type using artificial neural networks. J. Eng. Appl. Sci. 14, 3549–3556 (2019)

    Google Scholar 

  2. American Cryptogram Association: Cryptogram (2005). https://www.cryptogram.org/. Visited 14 April 2021

  3. 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

    Google Scholar 

  4. Brownlee, J.: Why use ensemble learning? October 2020. https://machinelearningmastery.com/why-use-ensemble-learning/. Visited 14 April 2021

  5. 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

    Chapter  Google Scholar 

  6. Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural Comput. 9, 1735–1780 (1997)

    Article  Google Scholar 

  7. Katz, J., Lindell, Y.: Introduction to Modern Cryptography. CRC Press, Boca Raton (2020)

    Google Scholar 

  8. 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

  9. 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)

    Google Scholar 

  10. Krishna, N.: Classifying Classic Ciphers using Machine Learning. Master’s thesis, San Jose State University, California, USA, May 2019

    Google Scholar 

  11. 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

  12. Leierzopf, E.: NCID - Neural Cipher Identifier (2021). https://github.com/dITySoftware/ncid

  13. 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)

    Google Scholar 

  14. 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

    Google Scholar 

  15. Megyesi, B., et al.: Decryption of historical manuscripts: the DECRYPT project. Cryptologia pp. 1–15 (2020). https://doi.org/10.1080/01611194.2020.1716410

  16. Nandan, A.: Text classification with transformer, May 2020. https://keras.io/examples/nlp/text_classification_with_transformer/

  17. Nuhn, M., Knight, K.: Cipher type detection. In: Conference on Empirical Methods In Natural Language Processing, pp. 1769–1773. Doha, Quatar, October 2014

    Google Scholar 

  18. Sivagurunathan, G., Rajendran, V., Purusothaman, T.: Classification of substitution ciphers using neural networks. IJCSNS Int. J. Comput. Sci. Network Secur. 10, 274–279 (2010)

    Google Scholar 

  19. Vaswani, A., et al.: Attention is all you need. In: 31st Conference on Neural Information Processing Systems, Long Beach, CA, USA (2017)

    Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Ernst Leierzopf .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics