Skip to main content

Parallel Implementation and Optimization of SM4 Based on CUDA

  • Conference paper
  • First Online:
Applied Cryptography in Computer and Communications (AC3 2021)

Abstract

SM4 is the 128-bit block cipher used in WAPI standard in China, which has a strong security and flexibility. In this paper, the rapid implementation of SM4 is given. Based on the characteristics of CUDA (Compute Unified Device Architecture), a CPU-GPU (Central Processing Unit-Graphics Processing Unit) scheme of SM4 is proposed by exploiting the structure property. Moreover, this scheme is further improved by introducing the page-locked memory and CUDA streams. The results show that: SM4 optimized parallel implementation under GPU can obtain with a speed-up ratio of 89, and the throughput can reach up to 31.41 Gbps.

This article is supported in part by the National Natural Science Foundation of China (61872103, 62062026), the Key Research and Development Plan of Guangxi (guike AB18281019), the Innovation Research Team Project of Guangxi (2019GXNSFGA245004), the scientific research project of young innovative talents of Guangxi (guike AD20238082), and the Science Research Foundation of Guilin University of Electronic Technology (UF19050Y).

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

References

  1. Kedem, G.-Y.: Brute force attack on UNIX passwords with SIMD computer. In: Proceedings of the 8th Conference on USENIX Security Symposium, pp. 93–98. USENIX Association, Washington, D.C. (1999)

    Google Scholar 

  2. Manavski, S.A.: CUDA compatible GPU as an efficient hardware accelerator for AES cryptography. In: 2007 IEEE International Conference on Signal Processing and Communications, pp. 65–68. Springer, Dubai (2007)

    Google Scholar 

  3. Harrison, O., Waldron, J.: Practical symmetric key cryptography on modern graphics hardware. In: Proceedings of the 17th USENIX Security Symposium, pp. 195–210. USENIX Association, San Jose (2008)

    Google Scholar 

  4. Xia, C., Zhou, D., Zhang, K., Liu, C., Chu, X.: CUDA based high-efficiency implementation of AES algorithm. 30(6), 1907–1909 (2013). (in Chinese)

    Google Scholar 

  5. Mei, X., Zhao, K., Liu, C., Chu, X.: Benchmarking the memory hierarchy of modern GPUs. In: Hsu, C.-H., Shi, X., Salapura, V. (eds.) NPC 2014. LNCS, vol. 8707, pp. 144–156. Springer, Heidelberg (2014). https://doi.org/10.1007/978-3-662-44917-2_13

    Chapter  Google Scholar 

  6. Mei, X., Chu, X.: Dissecting GPU memory hierarchy through microbenchmarking. IEEE Trans. Parallel Distrib. Syst. 28(1), 72–86 (2017)

    Article  Google Scholar 

  7. Fei, X., Chu, X., Yang, W.: Research and implementation of GPU parallel AES algorithm based on CTR model. J. Chin. Comput. Syst. 36(3), 529–533 (2015). (in Chinese)

    Google Scholar 

  8. Wang, D., Chen, D.: High speed implementation of SM4 encryption algorithm based on CUDA. J. Shijiazhuang Inst. Railway Technol. 16(1), 59–63 (2017). (in Chinese)

    Google Scholar 

  9. Wang, D., Chen, D.: Parallel implementation of SM4 algorithm on GPU. Inf. Netw. Secur. 20(6), 36–43 (2020). (in Chinese)

    Google Scholar 

  10. Yang, J., Wang, W., Xie Z., Han, J., Zeng X.: Parallel implementations of SHA-3 on a 24-core processor with software and hardware co-design. In: IEEE 12th International Conference on ASIC, pp. 953–956. IEEE Computer Society, Guiyang (2017)

    Google Scholar 

  11. Cheong, H., Lee, W.: Fast implementation of block ciphers and PRNGs for Kepler GPU architecture. In: International Conference on It Convergence and Security, pp. 1–5. IEEE Computer Society, Los Alamitos (2015)

    Google Scholar 

  12. NVIDIA Corporation, https://docs.nvidia.com/cuda/cuda-c-programming-guide. Accessed 23 Sep 2020

  13. Jason, S., Edward, K.: CUDA by Example: An Introduction to General-Purpose GPU Programming, 1st edn., Machinery Industry Press, Beijing (2011). (in Chinese)

    Google Scholar 

  14. Cheng, J.: Professional CUDA C Programming, 2nd edn., Machinery Industry Press, Beijing (2017). (in Chinese)

    Google Scholar 

  15. China’s National Cryptography Administration. http://www.sca.gov.cn/sca/c100061/201611/1002423/files/330480f731f64e1ea75138211ea0dc27.pdf. Accessed 18 Nov 2016. (in Chinese)

  16. Ma, J., Chen, X., Xu, R., Shi, J.: Implementation and evaluation of different parallel designs of AES using CUDA. In: IEEE Second International Conference on Data Science in Cyberspace, pp. 606–614. IEEE Computer Society, Shenzhen (2017)

    Google Scholar 

  17. Zhang, C.: Design and implementation of parallel SM4-GCM based on CUDA. Xi’an University of Electronic Ccience and Technology 2(1), 104 (2019).(in Chinese)

    Google Scholar 

  18. Cheng, W., Zheng, F., Pan, W., Lin, J., Li, H., Li, B.: High-performance symmetric cryptography server with GPU acceleration. In: Qing, S., Mitchell, C., Chen, L., Liu, D. (eds.) ICICS 2017. LNCS, vol. 10631, pp. 529–540. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-89500-0_46

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 ICST Institute for Computer Sciences, Social Informatics and Telecommunications Engineering

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Li, J., Xie, W., Li, L., Wu, X. (2021). Parallel Implementation and Optimization of SM4 Based on CUDA. In: Chen, B., Huang, X. (eds) Applied Cryptography in Computer and Communications. AC3 2021. Lecture Notes of the Institute for Computer Sciences, Social Informatics and Telecommunications Engineering, vol 386. Springer, Cham. https://doi.org/10.1007/978-3-030-80851-8_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-80851-8_7

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-80850-1

  • Online ISBN: 978-3-030-80851-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics