Journal of Information Security Reserach ›› 2023, Vol. 9 ›› Issue (10): 1001-.
Previous Articles Next Articles
Xie Zhenjie1,2, Fu Wei1, and Luo Fang1
Online:
Published:
谢振杰1,2付伟1罗芳1
通讯作者:
作者简介:
Abstract: The known Python libraries of domestic cryptographic algorithms are not working efficiently. By comprehensively using performance optimization methods such as precompilation, calling mature cryptographic algorithm library, precomputation, parallel execution, constructing doublebyte Sbox, reducing function calls, avoiding intermediate type conversion and optimizing code details, a highefficiency Python toolkit containing four domestic cryptographic algorithms SM2, SM3, SM4 and ZUC is developed. All algorithms in this toolkit contain the accelerated versions suitable for efficient machine operation and the nonaccelerated versions suitable for teaching. And the gap of open source Python code of SM2 key exchange protocol is filled. The comparative test shows that, comparing with the best performance in the existing open source domestic cryptographic algorithm Python libraries, the performance of SM2 in this toolkit is about 10 times, the performances of SM3, SM4 and ZUC can reach more than 100 times, which are equivalent to the performances of the mature international cryptographic algorithm Python library.
Key words: domestic cryptographic algorithm, Python, performance optimization, cryptographic algorithm library, software implementation
摘要: 针对现有国密算法Python库运行效率不高的问题,综合运用提前编译、调用成熟的密码运算链接库、预计算、并行执行、构造双字节S盒、减少函数调用、避免中间类型转换以及优化代码细节等性能优化方法,开发包含SM2,SM3,SM4,ZUC这4种国密算法的高效Python工具包.该工具包的所有算法均包含适合机器高效运行的加速版与适合教学的未加速版,填补了SM2密钥交换协议Python开源代码的空白.对比测试表明,相比现有开源国密算法Python库中性能最佳的实现,该工具包SM2性能为其10倍左右,而SM3,SM4,ZUC性能可达100倍以上,与成熟的国际密码算法Python库性能相当.
关键词: 国密算法, Python, 性能优化, 密码算法库, 软件实现
CLC Number:
TP311.56
谢振杰, 付伟, 罗芳, . 国密算法Python工具包的性能优化方法[J]. 信息安全研究, 2023, 9(10): 1001-.
0 / / Recommend
Add to citation manager EndNote|Ris|BibTeX
URL: http://www.sicris.cn/EN/
http://www.sicris.cn/EN/Y2023/V9/I10/1001